diff options
author | Phoebe Queen <foibey@gmail.com> | 2015-08-12 03:51:33 +0100 |
---|---|---|
committer | Phoebe Queen <foibey@gmail.com> | 2015-08-12 03:51:33 +0100 |
commit | 9fbb889347696db4a15e44b2c73d38aa47da8b97 (patch) | |
tree | 3805dc42922848e218de4f2bb017c340319ecd03 | |
parent | 754be60e2fb672950d97d1089df5ce2175e557b4 (diff) | |
download | cryptography-9fbb889347696db4a15e44b2c73d38aa47da8b97.tar.gz cryptography-9fbb889347696db4a15e44b2c73d38aa47da8b97.tar.bz2 cryptography-9fbb889347696db4a15e44b2c73d38aa47da8b97.zip |
added test for get_extension_for_class
-rw-r--r-- | tests/test_x509_ext.py | 10 |
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) |