summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2020-11-10 15:06:07 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2020-11-10 15:06:07 +0200
commit869244071caf4a0ebf73df38eacb1d4b183780d3 (patch)
tree869af238b0969791883187ccd0139a1f7d8e3d07
parenta1190da9b85222a351ea2764073eca1a7d0cab94 (diff)
downloadpysaml2-869244071caf4a0ebf73df38eacb1d4b183780d3.tar.gz
Amend test case adjustments
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
-rw-r--r--tests/fakeIDP.py11
-rw-r--r--tests/test_51_client.py2
2 files changed, 5 insertions, 8 deletions
diff --git a/tests/fakeIDP.py b/tests/fakeIDP.py
index 7aec9590..c2bd5612 100644
--- a/tests/fakeIDP.py
+++ b/tests/fakeIDP.py
@@ -43,8 +43,8 @@ def unpack_form(_str, ver="SAMLRequest"):
class DummyResponse(object):
- def __init__(self, code, data, headers=None):
- self.status_code = code
+ def __init__(self, status, data, headers=None):
+ self.status_code = status
self.text = data
self.headers = headers or []
self.content = data
@@ -130,8 +130,7 @@ class FakeIDP(Server):
_dict = pack.factory(_binding, response,
resp_args["destination"], relay_state,
"SAMLResponse")
- _dict.pop('status')
- return DummyResponse(200, **_dict)
+ return DummyResponse(**_dict)
def attribute_query_endpoint(self, xml_str, binding):
if binding == BINDING_SOAP:
@@ -161,7 +160,7 @@ class FakeIDP(Server):
else: # Just POST
response = "%s" % attr_resp
- return DummyResponse(200, response)
+ return DummyResponse(status=200, data=response)
def logout_endpoint(self, xml_str, binding):
if binding == BINDING_SOAP:
@@ -186,4 +185,4 @@ class FakeIDP(Server):
else: # Just POST
response = "%s" % _resp
- return DummyResponse(200, response)
+ return DummyResponse(status=200, data=response)
diff --git a/tests/test_51_client.py b/tests/test_51_client.py
index 86340cb7..d30a8746 100644
--- a/tests/test_51_client.py
+++ b/tests/test_51_client.py
@@ -3249,7 +3249,6 @@ class TestClientWithDummy():
# Here I fake what the client will do
# create the form post
- http_args.pop('status')
http_args["data"] = parse.urlencode(_dic)
http_args["method"] = "POST"
http_args["dummy"] = _dic["SAMLRequest"]
@@ -3286,7 +3285,6 @@ class TestClientWithDummy():
# Here I fake what the client will do
# create the form post
- http_args.pop('status')
http_args["data"] = parse.urlencode(_dic)
http_args["method"] = "POST"
http_args["dummy"] = _dic["SAMLRequest"]