diff --git a/tests/idp_all_conf.py b/tests/idp_all_conf.py index 4c881ec..3ff2fa9 100644 --- a/tests/idp_all_conf.py +++ b/tests/idp_all_conf.py @@ -86,7 +86,7 @@ CONFIG = { "debug": 1, "key_file": full_path("test.key"), "cert_file": full_path("test.pem"), - "xmlsec_binary": None, + "xmlsec_path": ["/usr/local/bin", "/opt/local/bin"], "metadata": { "local": [full_path("servera.xml"), full_path("vo_metadata.xml")], diff --git a/tests/test_30_mdstore.py b/tests/test_30_mdstore.py index 4366d71..ad78354 100644 --- a/tests/test_30_mdstore.py +++ b/tests/test_30_mdstore.py @@ -6,7 +6,8 @@ from saml2.mdstore import MetadataStore from saml2.mdstore import destinations from saml2.mdstore import name -from saml2 import md, sigver +from saml2 import md +from saml2 import sigver from saml2 import BINDING_SOAP from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_HTTP_POST diff --git a/tests/test_37_entity_categories.py b/tests/test_37_entity_categories.py index 7a532eb..85c5cd7 100644 --- a/tests/test_37_entity_categories.py +++ b/tests/test_37_entity_categories.py @@ -51,12 +51,12 @@ def test_filter_ava(): }) ava = {"givenName": ["Derek"], "sn": ["Jeter"], - "email": ["derek@nyy.mlb.com", "dj@example.com"], "c": ["USA"]} + "mail": ["derek@nyy.mlb.com", "dj@example.com"], "c": ["USA"]} ava = policy.filter(ava, "https://connect.sunet.se/shibboleth", MDS) - assert _eq(ava.keys(), ['email', 'givenName', 'sn', 'c']) - assert _eq(ava["email"], ["derek@nyy.mlb.com", "dj@example.com"]) + assert _eq(ava.keys(), ['mail', 'givenName', 'sn', 'c']) + assert _eq(ava["mail"], ["derek@nyy.mlb.com", "dj@example.com"]) def test_filter_ava2(): @@ -69,7 +69,7 @@ def test_filter_ava2(): }) ava = {"givenName": ["Derek"], "sn": ["Jeter"], - "email": ["derek@nyy.mlb.com"], "c": ["USA"], + "mail": ["derek@nyy.mlb.com"], "c": ["USA"], "eduPersonTargetedID": "foo!bar!xyz"} ava = policy.filter(ava, "https://connect.sunet.se/shibboleth", MDS) @@ -93,7 +93,7 @@ def test_filter_ava3(): mds.imp({"local": [full_path("entity_cat_sfs_hei.xml")]}) ava = {"givenName": ["Derek"], "sn": ["Jeter"], - "email": ["derek@nyy.mlb.com"], "c": ["USA"], + "mail": ["derek@nyy.mlb.com"], "c": ["USA"], "eduPersonTargetedID": "foo!bar!xyz", "norEduPersonNIN": "19800101134"} @@ -106,7 +106,7 @@ def test_idp_policy_filter(): idp = Server("idp_conf_ec") ava = {"givenName": ["Derek"], "sn": ["Jeter"], - "email": ["derek@nyy.mlb.com"], "c": ["USA"], + "mail": ["derek@nyy.mlb.com"], "c": ["USA"], "eduPersonTargetedID": "foo!bar!xyz", "norEduPersonNIN": "19800101134"} diff --git a/tests/test_51_client.py b/tests/test_51_client.py index d089ebd..87272d6 100644 --- a/tests/test_51_client.py +++ b/tests/test_51_client.py @@ -427,4 +427,9 @@ class TestClientWithDummy(): # if __name__ == "__main__": # tc = TestClient() # tc.setup_class() -# tc.test_response() \ No newline at end of file +# tc.test_response() + +if __name__ == "__main__": + tc = TestClientWithDummy() + tc.setup_class() + tc.test_post_sso() diff --git a/tests/test_66_name_id_mapping.py b/tests/test_66_name_id_mapping.py index 033d0fa..f8f51f3 100644 --- a/tests/test_66_name_id_mapping.py +++ b/tests/test_66_name_id_mapping.py @@ -7,6 +7,7 @@ from saml2.server import Server from saml2.samlp import NameIDPolicy from saml2.samlp import NameIDMappingRequest + def test_base_request(): sp = Saml2Client(config_file="servera_conf") idp = Server(config_file="idp_all_conf") @@ -26,6 +27,7 @@ def test_base_request(): assert isinstance(nmr, NameIDMappingRequest) + def test_request_response(): sp = Saml2Client(config_file="servera_conf") idp = Server(config_file="idp_all_conf") @@ -52,8 +54,8 @@ def test_request_response(): in_response_to = req.message.id name_id = NameID(format=NAMEID_FORMAT_PERSISTENT, text="foobar") - idp_response = idp.create_name_id_mapping_response(name_id, - in_response_to=in_response_to) + idp_response = idp.create_name_id_mapping_response( + name_id, in_response_to=in_response_to) print idp_response diff --git a/tests/test_76_metadata_in_mdb.py b/tests/test_76_metadata_in_mdb.py index 9f85399..077a3f4 100644 --- a/tests/test_76_metadata_in_mdb.py +++ b/tests/test_76_metadata_in_mdb.py @@ -1,10 +1,14 @@ # -*- coding: utf-8 -*- -from saml2.mongo_store import export_mdstore_to_mongo_db, MetadataMDB -from saml2.mdstore import MetadataStore, destinations, name __author__ = 'rolandh' -from saml2.attribute_converter import d_to_local_name, ac_factory +from saml2.attribute_converter import d_to_local_name +from saml2.attribute_converter import ac_factory +from saml2.mongo_store import export_mdstore_to_mongo_db +from saml2.mongo_store import MetadataMDB +from saml2.mdstore import MetadataStore +from saml2.mdstore import destinations +from saml2.mdstore import name from saml2 import saml from saml2 import md