aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-12-27 19:18:39 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2015-12-27 19:18:39 -0500
commit8b69cb9ba7b345c615999de7df6ccd35dcece027 (patch)
treeebc8b816514127330ffd5bf0e3475f9458a5f673 /tests
parent217fad8cb72b00b71d0f69287a1b76ddc8c42e92 (diff)
parentee2e92d32a984ffebe508108f1266315945b5cc5 (diff)
downloadcryptography-8b69cb9ba7b345c615999de7df6ccd35dcece027.tar.gz
cryptography-8b69cb9ba7b345c615999de7df6ccd35dcece027.tar.bz2
cryptography-8b69cb9ba7b345c615999de7df6ccd35dcece027.zip
Merge pull request #2597 from reaperhulk/index-cdp
support indexing in CDP
Diffstat (limited to 'tests')
-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 92e6e1a2..91833215 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -2964,6 +2964,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)