diff options
author | Fredrik Thulin <fredrik@thulin.net> | 2013-05-03 10:45:04 +0200 |
---|---|---|
committer | Fredrik Thulin <fredrik@thulin.net> | 2013-05-03 10:45:04 +0200 |
commit | 9501d8d6add739370e9b1a1f50a79cf60bffa8e2 (patch) | |
tree | a8ec53f16f402bc568a75ada2c81c3d47209ff71 /tests/test_31_config.py | |
parent | 3e7283cc59772bb66baa59e19e1a6832ea72d16e (diff) | |
parent | 6b082b6f5fee7786ff817b6ef555e3257eb4f3e6 (diff) | |
download | pysaml2-9501d8d6add739370e9b1a1f50a79cf60bffa8e2.tar.gz |
Merge branch 'master' into less_xmlsec_paths
Conflicts:
src/saml2/config.py
src/saml2/httpbase.py
tests/test_30_mdstore.py
tests/test_31_config.py
Diffstat (limited to 'tests/test_31_config.py')
-rw-r--r-- | tests/test_31_config.py | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/tests/test_31_config.py b/tests/test_31_config.py index eb912d52..20b5170a 100644 --- a/tests/test_31_config.py +++ b/tests/test_31_config.py @@ -11,6 +11,8 @@ from py.test import raises from saml2 import root_logger +from pathutils import dotname, full_path + sp1 = { "entityid" : "urn:mace:umu.se:saml:roland:sp", "service": { @@ -26,12 +28,11 @@ sp1 = { } } }, - "key_file" : "test.key", - "cert_file" : "test.pem", - #"xmlsec_binary" : "/opt/local/bin/xmlsec1", + "key_file" : full_path("test.key"), + "cert_file" : full_path("test.pem"), "metadata": { - "local": ["metadata.xml", - "urn-mace-swami.se-swamid-test-1.0-metadata.xml"], + "local": [full_path("metadata.xml"), + full_path("urn-mace-swami.se-swamid-test-1.0-metadata.xml")], }, "virtual_organization" : { "coip":{ @@ -42,7 +43,7 @@ sp1 = { ] } }, - "attribute_map_dir": "attributemaps", + "attribute_map_dir": full_path("attributemaps"), "only_use_keys_in_metadata": True, } @@ -124,8 +125,8 @@ PDP = { }, } }, - "key_file" : "test.key", - "cert_file" : "test.pem", + "key_file" : full_path("test.key"), + "cert_file" : full_path("test.pem"), "organization": { "name": "Exempel AB", "display_name": [("Exempel AB","se"),("Example Co.","en")], @@ -257,7 +258,10 @@ def test_wayf(): logging.handlers.RotatingFileHandler) handler = root_logger.handlers[0] assert handler.backupCount == 5 - assert handler.maxBytes == 100000 + try: + assert handler.maxBytes == 100000 + except AssertionError: + assert handler.maxBytes == 500000 assert handler.mode == "a" assert root_logger.name == "saml2" assert root_logger.level == 20 @@ -292,11 +296,11 @@ def test_conf_syslog(): #noinspection PyUnresolvedReferences def test_3(): cnf = Config() - cnf.load_file("sp_1_conf") + cnf.load_file(dotname("sp_1_conf")) assert cnf.entityid == "urn:mace:example.com:saml:roland:sp" assert cnf.debug == 1 - assert cnf.key_file == "test.key" - assert cnf.cert_file == "test.pem" + assert cnf.key_file == full_path("test.key") + assert cnf.cert_file == full_path("test.pem") #assert cnf.xmlsec_binary == "/usr/local/bin/xmlsec1" assert cnf.accepted_time_diff == 60 assert cnf.secret == "0123456789" @@ -305,12 +309,12 @@ def test_3(): def test_sp(): cnf = SPConfig() - cnf.load_file("sp_1_conf") + cnf.load_file(dotname("sp_1_conf")) assert cnf.endpoint("assertion_consumer_service") == \ ["http://lingon.catalogix.se:8087/"] def test_dual(): - cnf = Config().load_file("idp_sp_conf") + cnf = Config().load_file(dotname("idp_sp_conf")) spe = cnf.getattr("endpoints", "sp") idpe = cnf.getattr("endpoints", "idp") @@ -330,10 +334,10 @@ def test_ecp(): def test_assertion_consumer_service(): c = IdPConfig() - c.load_file("idp_conf") + c.load_file(dotname("idp_conf")) c.context = "idp" - c.metadata.load("local", "InCommon-metadata.xml") + c.metadata.load("local", full_path("InCommon-metadata.xml")) entity_id = "https://www.zimride.com/shibboleth" acs = c.metadata.assertion_consumer_service(entity_id) |