diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-05-29 07:37:01 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-05-29 07:37:01 -0400 |
commit | 13dcdf8ca1f9eba71fc2bcbcf2850cd08db5cdbb (patch) | |
tree | c6411f762c8b8c18e3ede3a178a1d55aa32236a2 /tests/test_x509_ext.py | |
parent | da5a321e0d4266f81ff89d2c7f7b233ad6a6bd41 (diff) | |
parent | 16fae766a47f84cab9dd153b92c249a40b27723e (diff) | |
download | cryptography-13dcdf8ca1f9eba71fc2bcbcf2850cd08db5cdbb.tar.gz cryptography-13dcdf8ca1f9eba71fc2bcbcf2850cd08db5cdbb.tar.bz2 cryptography-13dcdf8ca1f9eba71fc2bcbcf2850cd08db5cdbb.zip |
Merge pull request #1954 from reaperhulk/inhibitanypolicy
InhibitAnyPolicy class
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index ace38114..f16db337 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -2327,3 +2327,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() |