Skip to content

Commit a1190da

Browse files
committed
Issue #242: adjust test cases
1 parent a25103f commit a1190da

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

tests/fakeIDP.py

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +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')
133134
return DummyResponse(200, **_dict)
134135

135136
def attribute_query_endpoint(self, xml_str, binding):

tests/test_50_server.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2311,9 +2311,10 @@ def test_1(self):
23112311
binding, "%s" % response, destination, "relay_state", response=True
23122312
)
23132313

2314-
assert len(http_args) == 4
2314+
assert len(http_args) == 5
23152315
assert http_args["headers"][0][0] == "Location"
23162316
assert http_args["data"] == []
2317+
assert http_args["status"] == 303
23172318
assert http_args['url'] == 'http://lingon.catalogix.se:8087/sloresp'
23182319

23192320
def test_2(self):
@@ -2330,10 +2331,11 @@ def test_2(self):
23302331
binding, "%s" % response, destination, "relay_state", response=True
23312332
)
23322333

2333-
assert len(http_args) == 4
2334+
assert len(http_args) == 5
23342335
assert len(http_args["data"]) > 0
23352336
assert http_args["method"] == "POST"
23362337
assert http_args['url'] == 'http://lingon.catalogix.se:8087/slo'
2338+
assert http_args['status'] == 200
23372339

23382340

23392341
if __name__ == "__main__":

tests/test_51_client.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -3167,9 +3167,10 @@ def test_do_authn(self):
31673167
binding=binding, response_binding=response_binding)
31683168

31693169
assert isinstance(sid, six.string_types)
3170-
assert len(http_args) == 4
3170+
assert len(http_args) == 5
31713171
assert http_args["headers"][0][0] == "Location"
31723172
assert http_args["data"] == []
3173+
assert http_args["status"] == 303
31733174
redirect_url = http_args["headers"][0][1]
31743175
_, _, _, _, qs, _ = parse.urlparse(redirect_url)
31753176
qs_dict = parse.parse_qs(qs)
@@ -3188,9 +3189,10 @@ def test_do_negotiated_authn(self):
31883189

31893190
assert binding == auth_binding
31903191
assert isinstance(sid, six.string_types)
3191-
assert len(http_args) == 4
3192+
assert len(http_args) == 5
31923193
assert http_args["headers"][0][0] == "Location"
31933194
assert http_args["data"] == []
3195+
assert http_args["status"] == 303
31943196
redirect_url = http_args["headers"][0][1]
31953197
_, _, _, _, qs, _ = parse.urlparse(redirect_url)
31963198
qs_dict = parse.parse_qs(qs)
@@ -3247,6 +3249,7 @@ def test_post_sso(self):
32473249
# Here I fake what the client will do
32483250
# create the form post
32493251

3252+
http_args.pop('status')
32503253
http_args["data"] = parse.urlencode(_dic)
32513254
http_args["method"] = "POST"
32523255
http_args["dummy"] = _dic["SAMLRequest"]
@@ -3283,6 +3286,7 @@ def test_negotiated_post_sso(self):
32833286
# Here I fake what the client will do
32843287
# create the form post
32853288

3289+
http_args.pop('status')
32863290
http_args["data"] = parse.urlencode(_dic)
32873291
http_args["method"] = "POST"
32883292
http_args["dummy"] = _dic["SAMLRequest"]

0 commit comments

Comments
 (0)