aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-12-27 19:49:17 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2015-12-27 19:49:17 -0500
commitfb7659c5db43dd1e53d0934f27a3937bb4af3663 (patch)
tree0f685cb2bd626bb72b53ebe4aff38716b48623a0 /tests
parent8b69cb9ba7b345c615999de7df6ccd35dcece027 (diff)
parente8db7bd4bdc0a61214c8b6fe502d5d0ba9393749 (diff)
downloadcryptography-fb7659c5db43dd1e53d0934f27a3937bb4af3663.tar.gz
cryptography-fb7659c5db43dd1e53d0934f27a3937bb4af3663.tar.bz2
cryptography-fb7659c5db43dd1e53d0934f27a3937bb4af3663.zip
Merge pull request #2598 from reaperhulk/index-cp
support indexing in CertificatePolicies
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509_ext.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index 91833215..7cd24a69 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -380,6 +380,16 @@ class TestCertificatePolicies(object):
assert cp != cp2
assert cp != object()
+ def test_indexing(self):
+ pi = x509.PolicyInformation(x509.ObjectIdentifier("1.2.3"), [u"test"])
+ pi2 = x509.PolicyInformation(x509.ObjectIdentifier("1.2.4"), [u"test"])
+ pi3 = x509.PolicyInformation(x509.ObjectIdentifier("1.2.5"), [u"test"])
+ pi4 = x509.PolicyInformation(x509.ObjectIdentifier("1.2.6"), [u"test"])
+ pi5 = x509.PolicyInformation(x509.ObjectIdentifier("1.2.7"), [u"test"])
+ cp = x509.CertificatePolicies([pi, pi2, pi3, pi4, pi5])
+ assert cp[-1] == cp[4]
+ assert cp[2:6:2] == [cp[2], cp[4]]
+
@pytest.mark.requires_backend_interface(interface=RSABackend)
@pytest.mark.requires_backend_interface(interface=X509Backend)