aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-27 15:20:05 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-27 15:20:05 -0600
commit58fb25797de0ec8866836f2a075063feeb689289 (patch)
treef3dbe9b61daa741d3b52a5abb31ca0f6ee4d8307 /tests
parentb25888daba748af45bc96afbd08a25f3820ece52 (diff)
parent07d5cae4be47933f5001e8d28d0dddab6edeec3e (diff)
downloadcryptography-58fb25797de0ec8866836f2a075063feeb689289.tar.gz
cryptography-58fb25797de0ec8866836f2a075063feeb689289.tar.bz2
cryptography-58fb25797de0ec8866836f2a075063feeb689289.zip
Merge pull request #2595 from alex/crl-reason-hash
Refs #2578 -- implement __hash__ on CRLReason
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509_ext.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index 898f9bcf..cfca5794 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) == (