@@ -2297,6 +2297,7 @@ def _logout_request(conf_file):
2297
2297
2298
2298
2299
2299
class TestServerLogout ():
2300
+
2300
2301
def test_1 (self ):
2301
2302
with closing (Server ("idp_slo_redirect_conf" )) as server :
2302
2303
req_id , request = _logout_request ("sp_slo_redirect_conf" )
@@ -2305,15 +2306,33 @@ def test_1(self):
2305
2306
response = server .create_logout_response (request , bindings )
2306
2307
binding , destination = server .pick_binding ("single_logout_service" ,
2307
2308
bindings , "spsso" ,
2308
- request )
2309
+ request , response = True )
2309
2310
2310
2311
http_args = server .apply_binding (binding , "%s" % response , destination ,
2311
2312
"relay_state" , response = True )
2312
2313
2313
2314
assert len (http_args ) == 4
2314
2315
assert http_args ["headers" ][0 ][0 ] == "Location"
2315
2316
assert http_args ["data" ] == []
2317
+ assert http_args ['url' ] == 'http://lingon.catalogix.se:8087/sloresp'
2318
+
2319
+ def test_2 (self ):
2320
+ with closing (Server ("idp_slo_redirect_conf" )) as server :
2321
+ req_id , request = _logout_request ("sp_slo_redirect_conf" )
2322
+ print (request )
2323
+ bindings = [BINDING_HTTP_POST ]
2324
+ response = server .create_logout_response (request , bindings )
2325
+ binding , destination = server .pick_binding ("single_logout_service" ,
2326
+ bindings , "spsso" ,
2327
+ request , response = True )
2328
+
2329
+ http_args = server .apply_binding (binding , "%s" % response , destination ,
2330
+ "relay_state" , response = True )
2316
2331
2332
+ assert len (http_args ) == 4
2333
+ assert len (http_args ["data" ]) > 0
2334
+ assert http_args ["method" ] == "POST"
2335
+ assert http_args ['url' ] == 'http://lingon.catalogix.se:8087/slo'
2317
2336
2318
2337
if __name__ == "__main__" :
2319
2338
ts = TestServer1 ()
0 commit comments