Skip to content

Commit aa65423

Browse files
committed
Fix test
1 parent 60a3948 commit aa65423

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

tests/satosa/frontends/test_saml2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ def test_load_idp_dynamic_endpoints(self, context):
352352
def test_load_idp_dynamic_entity_id(self, idp_conf):
353353
state = State()
354354
state[self.frontend.name] = {"target_entity_id": self.TARGET_ENTITY_ID}
355+
state['target_backend'] = self.BACKEND
355356
idp = self.frontend._load_idp_dynamic_entity_id(state)
356-
assert idp.config.entityid == "{}/{}".format(idp_conf["entityid"], self.TARGET_ENTITY_ID)
357+
assert idp.config.entityid == "{}/{}/{}".format(idp_conf["entityid"], self.BACKEND, self.TARGET_ENTITY_ID)
357358

358359

359360
class TestSamlNameIdFormatToHashType:

tests/satosa/metadata_creation/test_saml_metadata.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ def assert_single_sign_on_endpoints_for_saml_frontend(self, entity_descriptor, s
3030

3131
def assert_single_sign_on_endpoints_for_saml_mirror_frontend(self, entity_descriptors, encoded_target_entity_id,
3232
saml_mirror_frontend_config, backend_names):
33-
expected_entity_id = saml_mirror_frontend_config["config"]["idp_config"][
34-
"entityid"] + "/" + encoded_target_entity_id
35-
metadata = InMemoryMetaData(None, None)
36-
for ed in entity_descriptors:
37-
metadata.parse(str(ed))
38-
sso = metadata.service(expected_entity_id, "idpsso_descriptor", "single_sign_on_service")
39-
4033
for backend_name in backend_names:
34+
expected_entity_id = saml_mirror_frontend_config["config"]["idp_config"][
35+
"entityid"] + "/" + backend_name + "/" + encoded_target_entity_id
36+
metadata = InMemoryMetaData(None, None)
37+
for ed in entity_descriptors:
38+
print("ed: {}".format(ed))
39+
metadata.parse(str(ed))
40+
sso = metadata.service(expected_entity_id, "idpsso_descriptor", "single_sign_on_service")
41+
42+
print("expected_entity_id: {}".format(expected_entity_id))
43+
print("sso: {}".format(sso))
44+
4145
for binding, path in saml_mirror_frontend_config["config"]["endpoints"]["single_sign_on_service"].items():
4246
sso_urls_for_binding = [endpoint["location"] for endpoint in sso[binding]]
4347
expected_url = "{}/{}/{}/{}".format(BASE_URL, backend_name, encoded_target_entity_id, path)

0 commit comments

Comments
 (0)