diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-12-27 15:30:39 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-12-27 15:30:39 -0500 |
commit | 07d5cae4be47933f5001e8d28d0dddab6edeec3e (patch) | |
tree | 2db9741bff5a9626e429b4270a8fd07f029706b7 /tests | |
parent | b04b67e06ea638e23e06f3fde151a6912c184025 (diff) | |
download | cryptography-07d5cae4be47933f5001e8d28d0dddab6edeec3e.tar.gz cryptography-07d5cae4be47933f5001e8d28d0dddab6edeec3e.tar.bz2 cryptography-07d5cae4be47933f5001e8d28d0dddab6edeec3e.zip |
Refs #2578 -- implement __hash__ on CRLReason
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_x509_ext.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 67081b23..8f961b0b 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -140,6 +140,14 @@ class TestCRLReason(object): assert reason1 != reason2 assert reason1 != object() + def test_hash(self): + reason1 = x509.CRLReason(x509.ReasonFlags.unspecified) + reason2 = x509.CRLReason(x509.ReasonFlags.unspecified) + reason3 = x509.CRLReason(x509.ReasonFlags.ca_compromise) + + assert hash(reason1) == hash(reason2) + assert hash(reason1) != hash(reason3) + def test_repr(self): reason1 = x509.CRLReason(x509.ReasonFlags.unspecified) assert repr(reason1) == ( |