summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2020-10-30 13:01:03 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2020-10-30 17:24:04 +0200
commit264101909354707f613c3ecc2d8d0ad0ddb7fa77 (patch)
tree3ccc40a56e5ace562257d70002b7f88dab26b902 /tests
parent915add35f4ae41c513534bdc5e159872cf2f1ff6 (diff)
downloadpysaml2-264101909354707f613c3ecc2d8d0ad0ddb7fa77.tar.gz
Remove the metadata_construction param
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/otest_61_makemeta.py44
-rw-r--r--tests/test_39_metadata.py6
-rw-r--r--tests/test_83_md_extensions.py6
3 files changed, 28 insertions, 28 deletions
diff --git a/tests/otest_61_makemeta.py b/tests/otest_61_makemeta.py
index 321d8b38..ba6fb0dc 100644
--- a/tests/otest_61_makemeta.py
+++ b/tests/otest_61_makemeta.py
@@ -116,7 +116,7 @@ def test_org_3():
org = metadata.do_organization_info(desc)
assert _eq(org.keyswv(), ['organization_display_name'])
assert len(org.organization_display_name) == 1
-
+
def test_contact_0():
conf = [{
"given_name":"Roland",
@@ -126,7 +126,7 @@ def test_contact_0():
"contact_type": "technical"
}]
contact_person = metadata.do_contact_person_info(conf)
- assert _eq(contact_person[0].keyswv(), ['given_name', 'sur_name',
+ assert _eq(contact_person[0].keyswv(), ['given_name', 'sur_name',
'contact_type', 'telephone_number',
"email_address"])
print(contact_person[0])
@@ -141,27 +141,27 @@ def test_contact_0():
assert len(person.email_address) == 2
assert isinstance(person.email_address[0], md.EmailAddress)
assert person.email_address[0].text == "foo@eample.com"
-
+
def test_do_endpoints():
eps = metadata.do_endpoints(SP["service"]["sp"]["endpoints"],
metadata.ENDPOINTS["sp"])
print(eps)
- assert _eq(eps.keys(), ["assertion_consumer_service",
+ assert _eq(eps.keys(), ["assertion_consumer_service",
"single_logout_service"])
-
+
assert len(eps["single_logout_service"]) == 1
sls = eps["single_logout_service"][0]
assert sls.location == "http://localhost:8087/logout"
assert sls.binding == BINDING_HTTP_POST
-
+
assert len(eps["assertion_consumer_service"]) == 1
acs = eps["assertion_consumer_service"][0]
assert acs.location == "http://localhost:8087/"
assert acs.binding == BINDING_HTTP_POST
-
+
assert "artifact_resolution_service" not in eps
assert "manage_name_id_service" not in eps
-
+
def test_required_attributes():
attrconverters = ac_factory("../tests/attributemaps")
ras = metadata.do_requested_attribute(
@@ -183,19 +183,19 @@ def test_optional_attributes():
assert ras[0].name == 'urn:oid:2.5.4.12'
assert ras[0].name_format == NAME_FORMAT_URI
assert ras[0].is_required == "false"
-
+
def test_do_sp_sso_descriptor():
- conf = SPConfig().load(SP, metadata_construction=True)
+ conf = SPConfig().load(SP)
spsso = metadata.do_spsso_descriptor(conf)
-
+
assert isinstance(spsso, md.SPSSODescriptor)
- assert _eq(spsso.keyswv(), ['authn_requests_signed',
- 'attribute_consuming_service',
- 'single_logout_service',
- 'protocol_support_enumeration',
- 'assertion_consumer_service',
+ assert _eq(spsso.keyswv(), ['authn_requests_signed',
+ 'attribute_consuming_service',
+ 'single_logout_service',
+ 'protocol_support_enumeration',
+ 'assertion_consumer_service',
'want_assertions_signed'])
-
+
assert spsso.authn_requests_signed == "false"
assert spsso.want_assertions_signed == "true"
assert len (spsso.attribute_consuming_service) == 1
@@ -213,8 +213,8 @@ def test_do_sp_sso_descriptor():
def test_do_sp_sso_descriptor_2():
SP["service"]["sp"]["discovery_response"] = "http://example.com/sp/ds"
-
- conf = SPConfig().load(SP, metadata_construction=True)
+
+ conf = SPConfig().load(SP)
spsso = metadata.do_spsso_descriptor(conf)
assert isinstance(spsso, md.SPSSODescriptor)
@@ -251,12 +251,12 @@ def test_entity_description():
assert entd.entity_id == "urn:mace:example.com:saml:roland:sp"
def test_do_idp_sso_descriptor():
- conf = IdPConfig().load(IDP, metadata_construction=True)
+ conf = IdPConfig().load(IDP)
idpsso = metadata.do_idpsso_descriptor(conf)
assert isinstance(idpsso, md.IDPSSODescriptor)
- assert _eq(idpsso.keyswv(), ['protocol_support_enumeration',
- 'single_sign_on_service',
+ assert _eq(idpsso.keyswv(), ['protocol_support_enumeration',
+ 'single_sign_on_service',
'want_authn_requests_signed',
"extensions"])
exts = idpsso.extensions.extension_elements
diff --git a/tests/test_39_metadata.py b/tests/test_39_metadata.py
index 8ab6dfa5..06de507a 100644
--- a/tests/test_39_metadata.py
+++ b/tests/test_39_metadata.py
@@ -30,7 +30,7 @@ sp_conf = {
def test_requested_attribute_name_format():
- cnf = SPConfig().load(sp_conf, metadata_construction=True)
+ cnf = SPConfig().load(sp_conf)
ed = entity_descriptor(cnf)
assert len(ed.spsso_descriptor.attribute_consuming_service) == 1
@@ -42,7 +42,7 @@ def test_requested_attribute_name_format():
sp2 = copy.copy(sp_conf)
sp2["service"]["sp"]["requested_attribute_name_format"] = NAME_FORMAT_BASIC
- cnf2 = SPConfig().load(sp2, metadata_construction=True)
+ cnf2 = SPConfig().load(sp2)
ed = entity_descriptor(cnf2)
acs = ed.spsso_descriptor.attribute_consuming_service[0]
assert len(acs.requested_attribute) == 4
@@ -56,7 +56,7 @@ def test_signed_metadata_proper_str_bytes_handling():
sp_conf_2['cert_file'] = full_path("inc-md-cert.pem")
# requires xmlsec binaries per https://pysaml2.readthedocs.io/en/latest/examples/sp.html
sp_conf_2['xmlsec_binary'] = sigver.get_xmlsec_binary(["/opt/local/bin"])
- cnf = SPConfig().load(sp_conf_2, metadata_construction=True)
+ cnf = SPConfig().load(sp_conf_2)
# This will raise TypeError if string/bytes handling is not correct
sp_metadata = create_metadata_string('', config=cnf, sign=True)
diff --git a/tests/test_83_md_extensions.py b/tests/test_83_md_extensions.py
index 35098595..df2c9125 100644
--- a/tests/test_83_md_extensions.py
+++ b/tests/test_83_md_extensions.py
@@ -9,7 +9,7 @@ from saml2.metadata import entity_descriptor
class TestMDExt():
def test_sp_type_true(self):
fil = "sp_mdext_conf.py"
- cnf = Config().load_file(fil, metadata_construction=True)
+ cnf = Config().load_file(fil)
ed = entity_descriptor(cnf)
assert ed.spsso_descriptor.extensions
@@ -20,7 +20,7 @@ class TestMDExt():
def test_sp_type_false(self):
fil = "sp_mdext_conf.py"
- cnf = Config().load_file(fil, metadata_construction=True)
+ cnf = Config().load_file(fil)
cnf.setattr('sp', 'sp_type_in_metadata', False)
ed = entity_descriptor(cnf)
@@ -28,7 +28,7 @@ class TestMDExt():
def test_entity_attributes(self):
fil = "sp_mdext_conf.py"
- cnf = Config().load_file(fil, metadata_construction=True)
+ cnf = Config().load_file(fil)
ed = entity_descriptor(cnf)
entity_attributes = next(