@@ -2297,6 +2297,7 @@ def _logout_request(conf_file):
22972297
22982298
22992299class TestServerLogout ():
2300+
23002301 def test_1 (self ):
23012302 with closing (Server ("idp_slo_redirect_conf" )) as server :
23022303 req_id , request = _logout_request ("sp_slo_redirect_conf" )
@@ -2305,15 +2306,33 @@ def test_1(self):
23052306 response = server .create_logout_response (request , bindings )
23062307 binding , destination = server .pick_binding ("single_logout_service" ,
23072308 bindings , "spsso" ,
2308- request )
2309+ request , response = True )
23092310
23102311 http_args = server .apply_binding (binding , "%s" % response , destination ,
23112312 "relay_state" , response = True )
23122313
23132314 assert len (http_args ) == 4
23142315 assert http_args ["headers" ][0 ][0 ] == "Location"
23152316 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 )
23162331
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'
23172336
23182337if __name__ == "__main__" :
23192338 ts = TestServer1 ()
0 commit comments