summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHans Kuder <hanskuder@gmail.com>2017-03-20 11:41:45 -0500
committerHans Kuder <hanskuder@gmail.com>2017-03-20 11:41:45 -0500
commit546f9d4ca82c8b4ae5cf7aa0fb80f0bedf385c89 (patch)
treec1b35224197e77c2f608e8f2a1e5515a7ae0af7d /tests
parent53d05ea5c6f2f3b41e044b559fb4fbf6afa8183d (diff)
downloadpysaml2-546f9d4ca82c8b4ae5cf7aa0fb80f0bedf385c89.tar.gz
Skip test if optional pyasn1 is not installed
Diffstat (limited to 'tests')
-rw-r--r--tests/test_40_sigver.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_40_sigver.py b/tests/test_40_sigver.py
index e2ba952f..2511efc4 100644
--- a/tests/test_40_sigver.py
+++ b/tests/test_40_sigver.py
@@ -18,6 +18,7 @@ from saml2.saml import EncryptedAssertion
from saml2.samlp import response_from_string
from saml2.s_utils import factory, do_attribute_statement
+import pytest
from py.test import raises
from pathutils import full_path
@@ -67,7 +68,10 @@ Yj4cAafWaYfjBU2zi1ElwStIaJ5nyp/s/8B8SAPK2T79McMyccP3wSW13LHkmM1j
wKe3ACFXBvqGQN0IbcH49hu0FKhYFM/GPDJcIHFBsiyMBXChpye9vBaTNEBCtU3K
jjyG0hRT2mAQ9h+bkPmOvlEo/aH0xR68Z9hw4PF13w=="""
-from pyasn1.codec.der import decoder
+try:
+ from pyasn1.codec.der import decoder
+except ImportError:
+ decoder = None
def test_cert_from_instance_1():
@@ -80,6 +84,8 @@ def test_cert_from_instance_1():
assert certs[0] == CERT1
+@pytest.mark.skipif(not decoder,
+ reason="pyasn1 is not installed")
def test_cert_from_instance_ssp():
xml_response = open(SIMPLE_SAML_PHP_RESPONSE).read()
response = samlp.response_from_string(xml_response)