Skip to content

Commit fa18536

Browse files
committed
test: add logout arguments to satosa/frontends/test_saml2 to fix tests
1 parent 0ec992e commit fa18536

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/satosa/frontends/test_saml2.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def setup_for_authn_req(self, context, idp_conf, sp_conf, nameid_format=None, re
6969

7070
base_url = self.construct_base_url_from_entity_id(idp_conf["entityid"])
7171
samlfrontend = SAMLFrontend(lambda ctx, internal_req: (ctx, internal_req),
72+
lambda ctx, internal_logout_req: (ctx, internal_logout_req),
7273
internal_attributes, config, base_url, "saml_frontend")
7374
samlfrontend.register_endpoints(["saml"])
7475

@@ -119,7 +120,8 @@ def get_auth_response(self, samlfrontend, context, internal_response, sp_conf, i
119120
])
120121
def test_config_error_handling(self, conf):
121122
with pytest.raises(ValueError):
122-
SAMLFrontend(lambda ctx, req: None, INTERNAL_ATTRIBUTES, conf, "base_url", "saml_frontend")
123+
SAMLFrontend(lambda ctx, req: None, lambda ctx, req: None,
124+
INTERNAL_ATTRIBUTES, conf, "base_url", "saml_frontend")
123125

124126
def test_register_endpoints(self, idp_conf):
125127
"""
@@ -133,6 +135,7 @@ def get_path_from_url(url):
133135

134136
base_url = self.construct_base_url_from_entity_id(idp_conf["entityid"])
135137
samlfrontend = SAMLFrontend(lambda context, internal_req: (context, internal_req),
138+
lambda context, internal_logout_req: (context, internal_logout_req),
136139
INTERNAL_ATTRIBUTES, config, base_url, "saml_frontend")
137140

138141
providers = ["foo", "bar"]
@@ -247,7 +250,7 @@ def test_get_filter_attributes_with_sp_requested_attributes_without_friendlyname
247250
"eduPersonAffiliation", "mail", "displayName", "sn",
248251
"givenName"]}} # no op mapping for saml attribute names
249252

250-
samlfrontend = SAMLFrontend(None, internal_attributes, conf, base_url, "saml_frontend")
253+
samlfrontend = SAMLFrontend(None, None, internal_attributes, conf, base_url, "saml_frontend")
251254
samlfrontend.register_endpoints(["testprovider"])
252255

253256
internal_req = InternalData(
@@ -357,7 +360,8 @@ def test_sp_metadata_without_uiinfo(self, context, idp_conf, sp_conf):
357360

358361
def test_metadata_endpoint(self, context, idp_conf):
359362
conf = {"idp_config": idp_conf, "endpoints": ENDPOINTS}
360-
samlfrontend = SAMLFrontend(lambda ctx, req: None, INTERNAL_ATTRIBUTES, conf, "base_url", "saml_frontend")
363+
samlfrontend = SAMLFrontend(lambda ctx, req: None, lambda ctx, req: None,
364+
INTERNAL_ATTRIBUTES, conf, "base_url", "saml_frontend")
361365
samlfrontend.register_endpoints(["todo"])
362366
resp = samlfrontend._metadata_endpoint(context)
363367
headers = dict(resp.headers)
@@ -399,7 +403,8 @@ class TestSAMLMirrorFrontend:
399403
@pytest.fixture(autouse=True)
400404
def create_frontend(self, idp_conf):
401405
conf = {"idp_config": idp_conf, "endpoints": ENDPOINTS}
402-
self.frontend = SAMLMirrorFrontend(lambda ctx, req: None, INTERNAL_ATTRIBUTES, conf, BASE_URL,
406+
self.frontend = SAMLMirrorFrontend(lambda ctx, req: None, lambda ctx, req: None,
407+
INTERNAL_ATTRIBUTES, conf, BASE_URL,
403408
"saml_mirror_frontend")
404409
self.frontend.register_endpoints([self.BACKEND])
405410

@@ -490,6 +495,7 @@ def frontend(self, idp_conf, sp_conf):
490495
# Create, register the endpoints, and then return the frontend
491496
# instance.
492497
frontend = SAMLVirtualCoFrontend(lambda ctx, req: None,
498+
lambda ctx, logout_req: None,
493499
internal_attributes,
494500
conf,
495501
BASE_URL,

0 commit comments

Comments
 (0)