aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-12-24 11:04:21 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2015-12-24 11:04:21 -0500
commit9f71bf79971d5365a4a89cfbc6b29197a57e9042 (patch)
treed935b37c6deee3e4e3e41606671898dfcbf201ab /tests
parenta1476217655be21dde7453fd35d80b8fae3ecb1a (diff)
downloadcryptography-9f71bf79971d5365a4a89cfbc6b29197a57e9042.tar.gz
cryptography-9f71bf79971d5365a4a89cfbc6b29197a57e9042.tar.bz2
cryptography-9f71bf79971d5365a4a89cfbc6b29197a57e9042.zip
tests on indexing
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index ab4d6660..099dfd5f 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -332,7 +332,6 @@ class TestCertificateRevocationList(object):
@pytest.mark.requires_backend_interface(interface=X509Backend)
class TestRevokedCertificate(object):
-
def test_revoked_basics(self, backend):
crl = _load_cert(
os.path.join("x509", "custom", "crl_all_reasons.pem"),
@@ -460,6 +459,18 @@ class TestRevokedCertificate(object):
with pytest.raises(ValueError):
crl[0].extensions
+ def test_indexing(self, backend):
+ crl = _load_cert(
+ os.path.join("x509", "custom", "crl_empty.pem"),
+ x509.load_pem_x509_crl,
+ backend
+ )
+
+ with pytest.raises(IndexError):
+ crl[-1]
+ with pytest.raises(IndexError):
+ crl[0]
+
@pytest.mark.requires_backend_interface(interface=RSABackend)
@pytest.mark.requires_backend_interface(interface=X509Backend)