aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-10-20 08:08:43 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-10-20 08:08:43 -0500
commitafbe75bf4fb6c288a7e25b2c58a72ec7049f3f64 (patch)
treeca960f9dfce398876070992379a83cc8e155d617 /tests/test_x509_ext.py
parent08801cd1bacf08aa4d4a833ff235574f4da15a20 (diff)
downloadcryptography-afbe75bf4fb6c288a7e25b2c58a72ec7049f3f64.tar.gz
cryptography-afbe75bf4fb6c288a7e25b2c58a72ec7049f3f64.tar.bz2
cryptography-afbe75bf4fb6c288a7e25b2c58a72ec7049f3f64.zip
add __repr__ to x509.Extensions
fix #2434
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r--tests/test_x509_ext.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index 1bc14620..8f469366 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -857,6 +857,20 @@ class TestExtensions(object):
assert ext is not None
assert isinstance(ext.value, x509.BasicConstraints)
+ def test_repr(self, backend):
+ cert = _load_cert(
+ os.path.join(
+ "x509", "custom", "basic_constraints_not_critical.pem"
+ ),
+ x509.load_pem_x509_certificate,
+ backend
+ )
+ assert repr(cert.extensions) == (
+ "<Extensions([<Extension(oid=<ObjectIdentifier(oid=2.5.29.19, name"
+ "=basicConstraints)>, critical=False, value=<BasicConstraints(ca=F"
+ "alse, path_length=None)>)>])>"
+ )
+
@pytest.mark.requires_backend_interface(interface=RSABackend)
@pytest.mark.requires_backend_interface(interface=X509Backend)