Skip to content

Commit 8692440

Browse files
committed
Amend test case adjustments
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent a1190da commit 8692440

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Diff for: tests/fakeIDP.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def unpack_form(_str, ver="SAMLRequest"):
4343

4444

4545
class DummyResponse(object):
46-
def __init__(self, code, data, headers=None):
47-
self.status_code = code
46+
def __init__(self, status, data, headers=None):
47+
self.status_code = status
4848
self.text = data
4949
self.headers = headers or []
5050
self.content = data
@@ -130,8 +130,7 @@ def authn_request_endpoint(self, req, binding, relay_state):
130130
_dict = pack.factory(_binding, response,
131131
resp_args["destination"], relay_state,
132132
"SAMLResponse")
133-
_dict.pop('status')
134-
return DummyResponse(200, **_dict)
133+
return DummyResponse(**_dict)
135134

136135
def attribute_query_endpoint(self, xml_str, binding):
137136
if binding == BINDING_SOAP:
@@ -161,7 +160,7 @@ def attribute_query_endpoint(self, xml_str, binding):
161160
else: # Just POST
162161
response = "%s" % attr_resp
163162

164-
return DummyResponse(200, response)
163+
return DummyResponse(status=200, data=response)
165164

166165
def logout_endpoint(self, xml_str, binding):
167166
if binding == BINDING_SOAP:
@@ -186,4 +185,4 @@ def logout_endpoint(self, xml_str, binding):
186185
else: # Just POST
187186
response = "%s" % _resp
188187

189-
return DummyResponse(200, response)
188+
return DummyResponse(status=200, data=response)

Diff for: tests/test_51_client.py

-2
Original file line numberDiff line numberDiff line change
@@ -3249,7 +3249,6 @@ def test_post_sso(self):
32493249
# Here I fake what the client will do
32503250
# create the form post
32513251

3252-
http_args.pop('status')
32533252
http_args["data"] = parse.urlencode(_dic)
32543253
http_args["method"] = "POST"
32553254
http_args["dummy"] = _dic["SAMLRequest"]
@@ -3286,7 +3285,6 @@ def test_negotiated_post_sso(self):
32863285
# Here I fake what the client will do
32873286
# create the form post
32883287

3289-
http_args.pop('status')
32903288
http_args["data"] = parse.urlencode(_dic)
32913289
http_args["method"] = "POST"
32923290
http_args["dummy"] = _dic["SAMLRequest"]

0 commit comments

Comments
 (0)