aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-02-27 13:36:22 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2016-02-27 13:36:22 -0500
commitebb7fa14094ac39443f246885a02487fa529506b (patch)
tree61e1c5f00b175046f4f674dffb2c9036050a5edb /tests/test_x509_ext.py
parent6578182915568e35d8813d2ee697478b00f09145 (diff)
downloadcryptography-ebb7fa14094ac39443f246885a02487fa529506b.tar.gz
cryptography-ebb7fa14094ac39443f246885a02487fa529506b.tar.bz2
cryptography-ebb7fa14094ac39443f246885a02487fa529506b.zip
added another test
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r--tests/test_x509_ext.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index fd579d6f..d85b4bbc 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -2285,9 +2285,7 @@ class TestPolicyConstraints(object):
class TestPolicyConstraintsExtension(object):
def test_inhibit_policy_mapping(self, backend):
cert = _load_cert(
- os.path.join(
- "x509", "department-of-state-root.pem"
- ),
+ os.path.join("x509", "department-of-state-root.pem"),
x509.load_pem_x509_certificate,
backend
)
@@ -2300,6 +2298,20 @@ class TestPolicyConstraintsExtension(object):
require_explicit_policy=None, inhibit_policy_mapping=0,
)
+ def test_require_explicit_policy(self, backend):
+ cert = _load_cert(
+ os.path.join("x509", "custom", "policy_constraints_explicit.pem"),
+ x509.load_pem_x509_certificate,
+ backend
+ )
+ ext = cert.extensions.get_extension_for_oid(
+ ExtensionOID.POLICY_CONSTRAINTS
+ )
+ assert ext.critical is True
+ assert ext.value == x509.PolicyConstraints(
+ require_explicit_policy=1, inhibit_policy_mapping=None,
+ )
+
class TestAuthorityInformationAccess(object):
def test_invalid_descriptions(self):