summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorXiao Zhu <xzhu@twitter.com>2021-10-28 16:00:55 -0700
committerIvan Kanakarakis <ivan.kanak@gmail.com>2022-04-19 14:05:15 +0300
commitfc3e4af8ed5ec8e29e96912d4f0c746fbf1b5a37 (patch)
treee0645acbe75cfa32a9e48cef98f1558f13b8a63a /tests
parentc290f1c06e0548ed850403d46959b36cf62c0ba6 (diff)
downloadpysaml2-fc3e4af8ed5ec8e29e96912d4f0c746fbf1b5a37.tar.gz
update tests
Diffstat (limited to 'tests')
-rw-r--r--tests/sp_1_conf.py1
-rw-r--r--tests/test_30_mdstore.py11
-rw-r--r--tests/test_31_config.py1
3 files changed, 10 insertions, 3 deletions
diff --git a/tests/sp_1_conf.py b/tests/sp_1_conf.py
index 834ff15a..6d289e54 100644
--- a/tests/sp_1_conf.py
+++ b/tests/sp_1_conf.py
@@ -48,4 +48,5 @@ CONFIG = {
},
],
"secret": "0123456789",
+ "timeout": 10,
}
diff --git a/tests/test_30_mdstore.py b/tests/test_30_mdstore.py
index 8ce058b7..49ab146b 100644
--- a/tests/test_30_mdstore.py
+++ b/tests/test_30_mdstore.py
@@ -462,12 +462,14 @@ def test_load_extern_incommon(mock_request):
sec_config.xmlsec_binary = sigver.get_xmlsec_binary(["/opt/local/bin"])
mds = MetadataStore(ATTRCONV, sec_config,
- disable_ssl_certificate_validation=True)
+ disable_ssl_certificate_validation=True,
+ timeout=10)
mds.imp(METADATACONF["10"])
print(mds)
assert mds
assert len(mds.keys())
+ mock_request.assert_called_with('GET', 'http://md.incommon.org/InCommon/InCommon-metadata-export.xml', allow_redirects=False, verify=False, timeout=10)
def test_load_local():
@@ -495,10 +497,13 @@ def test_load_remote_encoding(mock_request):
crypto = sigver._get_xmlsec_cryptobackend()
sc = sigver.SecurityContext(crypto, key_type="", cert_type="")
- httpc = HTTPBase()
- mds = MetaDataExtern(ATTRCONV, 'http://metadata.aai.switch.ch/metadata.aaitest.xml', sc, full_path('SWITCHaaiRootCA.crt.pem'), httpc)
+ url = 'http://metadata.aai.switch.ch/metadata.aaitest.xml'
+ httpc = HTTPBase(timeout=10)
+ mds = MetaDataExtern(ATTRCONV, url, sc, full_path('SWITCHaaiRootCA.crt.pem'), httpc)
mds.load()
+ mock_request.assert_called_with('GET', url, allow_redirects=False, verify=True, timeout=10)
+
def test_load_string():
sec_config.xmlsec_binary = sigver.get_xmlsec_binary(["/opt/local/bin"])
diff --git a/tests/test_31_config.py b/tests/test_31_config.py
index d58b9a01..4e9fa565 100644
--- a/tests/test_31_config.py
+++ b/tests/test_31_config.py
@@ -338,6 +338,7 @@ def test_3():
assert cnf.secret == "0123456789"
assert cnf.metadata is not None
assert cnf.attribute_converters is not None
+ assert cnf.timeout == 10
def test_sp():