aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-27 17:29:37 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-27 17:29:37 -0600
commitee2e92d32a984ffebe508108f1266315945b5cc5 (patch)
tree193e23eb1f151ad209a25f54663c84ae8cf95c77 /tests/test_x509_ext.py
parent58fb25797de0ec8866836f2a075063feeb689289 (diff)
downloadcryptography-ee2e92d32a984ffebe508108f1266315945b5cc5.tar.gz
cryptography-ee2e92d32a984ffebe508108f1266315945b5cc5.tar.bz2
cryptography-ee2e92d32a984ffebe508108f1266315945b5cc5.zip
support indexing in CDP
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r--tests/test_x509_ext.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index cfca5794..7e46e5a1 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -2938,6 +2938,32 @@ class TestCRLDistributionPoints(object):
assert cdp != cdp4
assert cdp != object()
+ def test_indexing(self):
+ ci = x509.CRLDistributionPoints([
+ x509.DistributionPoint(
+ None, None, None,
+ [x509.UniformResourceIdentifier(u"uri://thing")],
+ ),
+ x509.DistributionPoint(
+ None, None, None,
+ [x509.UniformResourceIdentifier(u"uri://thing2")],
+ ),
+ x509.DistributionPoint(
+ None, None, None,
+ [x509.UniformResourceIdentifier(u"uri://thing3")],
+ ),
+ x509.DistributionPoint(
+ None, None, None,
+ [x509.UniformResourceIdentifier(u"uri://thing4")],
+ ),
+ x509.DistributionPoint(
+ None, None, None,
+ [x509.UniformResourceIdentifier(u"uri://thing5")],
+ ),
+ ])
+ assert ci[-1] == ci[4]
+ assert ci[2:6:2] == [ci[2], ci[4]]
+
@pytest.mark.requires_backend_interface(interface=RSABackend)
@pytest.mark.requires_backend_interface(interface=X509Backend)