aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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):