aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-01 23:14:20 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-26 19:49:48 -0500
commit16fae766a47f84cab9dd153b92c249a40b27723e (patch)
tree237c19e43e0e6366937c473b78bab75c583616a2 /tests
parent7e6172104ee755fa92f202a7fd47bca8d38f01da (diff)
downloadcryptography-16fae766a47f84cab9dd153b92c249a40b27723e.tar.gz
cryptography-16fae766a47f84cab9dd153b92c249a40b27723e.tar.bz2
cryptography-16fae766a47f84cab9dd153b92c249a40b27723e.zip
InhibitAnyPolicy class
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509_ext.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index 20a016b6..0405b798 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -2271,3 +2271,28 @@ class TestCRLDistributionPointsExtension(object):
)],
)
])
+
+
+class TestInhibitAnyPolicy(object):
+ def test_not_int(self):
+ with pytest.raises(TypeError):
+ x509.InhibitAnyPolicy("notint")
+
+ def test_negative_int(self):
+ with pytest.raises(ValueError):
+ x509.InhibitAnyPolicy(-1)
+
+ def test_repr(self):
+ iap = x509.InhibitAnyPolicy(0)
+ assert repr(iap) == "<InhibitAnyPolicy(skip_certs=0)>"
+
+ def test_eq(self):
+ iap = x509.InhibitAnyPolicy(1)
+ iap2 = x509.InhibitAnyPolicy(1)
+ assert iap == iap2
+
+ def test_ne(self):
+ iap = x509.InhibitAnyPolicy(1)
+ iap2 = x509.InhibitAnyPolicy(4)
+ assert iap != iap2
+ assert iap != object()