diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-25 22:28:29 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-26 10:10:27 -0600 |
commit | 7058eced3a27115f721887e836d16ee4fe4c7e9d (patch) | |
tree | 796e8feff62e053b9a73626402424e322dfe48bd /tests/test_x509_ext.py | |
parent | 0860ef60adc7974dc26cfdd3c7adeb5e4e6e6448 (diff) | |
download | cryptography-7058eced3a27115f721887e836d16ee4fe4c7e9d.tar.gz cryptography-7058eced3a27115f721887e836d16ee4fe4c7e9d.tar.bz2 cryptography-7058eced3a27115f721887e836d16ee4fe4c7e9d.zip |
switch CRLReason to use a class
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 037512a4..b8105a4b 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -112,6 +112,29 @@ class TestCertificateIssuer(object): assert names == [u"cryptography.io"] +class TestCRLReason(object): + def test_invalid_reason_flags(self): + with pytest.raises(TypeError): + x509.CRLReason("notareason") + + def test_eq(self): + reason1 = x509.CRLReason(x509.ReasonFlags.unspecified) + reason2 = x509.CRLReason(x509.ReasonFlags.unspecified) + assert reason1 == reason2 + + def test_ne(self): + reason1 = x509.CRLReason(x509.ReasonFlags.unspecified) + reason2 = x509.CRLReason(x509.ReasonFlags.ca_compromise) + assert reason1 != reason2 + assert reason1 != object() + + def test_repr(self): + reason1 = x509.CRLReason(x509.ReasonFlags.unspecified) + assert repr(reason1) == ( + "<CRLReason(reason=ReasonFlags.unspecified)>" + ) + + class TestNoticeReference(object): def test_notice_numbers_not_all_int(self): with pytest.raises(TypeError): |