aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhoebe Queen <foibey@gmail.com>2015-08-12 03:51:33 +0100
committerPhoebe Queen <foibey@gmail.com>2015-08-12 03:51:33 +0100
commit9fbb889347696db4a15e44b2c73d38aa47da8b97 (patch)
tree3805dc42922848e218de4f2bb017c340319ecd03 /tests
parent754be60e2fb672950d97d1089df5ce2175e557b4 (diff)
downloadcryptography-9fbb889347696db4a15e44b2c73d38aa47da8b97.tar.gz
cryptography-9fbb889347696db4a15e44b2c73d38aa47da8b97.tar.bz2
cryptography-9fbb889347696db4a15e44b2c73d38aa47da8b97.zip
added test for get_extension_for_class
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509_ext.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index 2c5438a9..a05dc2a4 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -832,6 +832,16 @@ class TestExtensions(object):
extensions = cert.extensions
assert len(extensions) == 0
+ def test_one_extension_get_for_class(self, backend):
+ cert = _load_cert(
+ os.path.join("x509", "custom", "basic_constraints_not_critical.pem"),
+ x509.load_pem_x509_certificate,
+ backend
+ )
+ ext = cert.extensions.get_extension_for_class(x509.BasicConstraints)
+ assert ext is not None
+
+ assert isinstance(ext.value, x509.BasicConstraints)
@pytest.mark.requires_backend_interface(interface=RSABackend)
@pytest.mark.requires_backend_interface(interface=X509Backend)