summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Best <best@univention.de>2020-11-09 21:15:47 +0100
committerFlorian Best <best@univention.de>2020-11-10 01:08:15 +0100
commita1190da9b85222a351ea2764073eca1a7d0cab94 (patch)
tree14b728c7f03698e87c67cc0e69692ef73cbe0f7d
parenta25103fc1f9cff95716d86925f3362f355c98ed5 (diff)
downloadpysaml2-a1190da9b85222a351ea2764073eca1a7d0cab94.tar.gz
Issue #242: adjust test cases
-rw-r--r--tests/fakeIDP.py1
-rw-r--r--tests/test_50_server.py6
-rw-r--r--tests/test_51_client.py8
3 files changed, 11 insertions, 4 deletions
diff --git a/tests/fakeIDP.py b/tests/fakeIDP.py
index 123c347a..7aec9590 100644
--- a/tests/fakeIDP.py
+++ b/tests/fakeIDP.py
@@ -130,6 +130,7 @@ class FakeIDP(Server):
_dict = pack.factory(_binding, response,
resp_args["destination"], relay_state,
"SAMLResponse")
+ _dict.pop('status')
return DummyResponse(200, **_dict)
def attribute_query_endpoint(self, xml_str, binding):
diff --git a/tests/test_50_server.py b/tests/test_50_server.py
index 2aee6d8a..7ee82499 100644
--- a/tests/test_50_server.py
+++ b/tests/test_50_server.py
@@ -2311,9 +2311,10 @@ class TestServerLogout():
binding, "%s" % response, destination, "relay_state", response=True
)
- assert len(http_args) == 4
+ assert len(http_args) == 5
assert http_args["headers"][0][0] == "Location"
assert http_args["data"] == []
+ assert http_args["status"] == 303
assert http_args['url'] == 'http://lingon.catalogix.se:8087/sloresp'
def test_2(self):
@@ -2330,10 +2331,11 @@ class TestServerLogout():
binding, "%s" % response, destination, "relay_state", response=True
)
- assert len(http_args) == 4
+ assert len(http_args) == 5
assert len(http_args["data"]) > 0
assert http_args["method"] == "POST"
assert http_args['url'] == 'http://lingon.catalogix.se:8087/slo'
+ assert http_args['status'] == 200
if __name__ == "__main__":
diff --git a/tests/test_51_client.py b/tests/test_51_client.py
index c1d52531..86340cb7 100644
--- a/tests/test_51_client.py
+++ b/tests/test_51_client.py
@@ -3167,9 +3167,10 @@ class TestClientWithDummy():
binding=binding, response_binding=response_binding)
assert isinstance(sid, six.string_types)
- assert len(http_args) == 4
+ assert len(http_args) == 5
assert http_args["headers"][0][0] == "Location"
assert http_args["data"] == []
+ assert http_args["status"] == 303
redirect_url = http_args["headers"][0][1]
_, _, _, _, qs, _ = parse.urlparse(redirect_url)
qs_dict = parse.parse_qs(qs)
@@ -3188,9 +3189,10 @@ class TestClientWithDummy():
assert binding == auth_binding
assert isinstance(sid, six.string_types)
- assert len(http_args) == 4
+ assert len(http_args) == 5
assert http_args["headers"][0][0] == "Location"
assert http_args["data"] == []
+ assert http_args["status"] == 303
redirect_url = http_args["headers"][0][1]
_, _, _, _, qs, _ = parse.urlparse(redirect_url)
qs_dict = parse.parse_qs(qs)
@@ -3247,6 +3249,7 @@ 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"]
@@ -3283,6 +3286,7 @@ 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"]