From ebb7fa14094ac39443f246885a02487fa529506b Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 27 Feb 2016 13:36:22 -0500 Subject: added another test --- tests/test_x509_ext.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tests/test_x509_ext.py') 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): -- cgit v1.2.3