diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-26 11:37:14 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-26 11:37:14 -0600 |
commit | 67cde769bd98f701e88e051b74a9db7ae4f03f00 (patch) | |
tree | f3a993fd8aa64092f98a25e5dcd97e676e054a61 /tests/test_x509_ext.py | |
parent | 23c0bbc2dc007aa507b22f407c3a0048be98a1a4 (diff) | |
download | cryptography-67cde769bd98f701e88e051b74a9db7ae4f03f00.tar.gz cryptography-67cde769bd98f701e88e051b74a9db7ae4f03f00.tar.bz2 cryptography-67cde769bd98f701e88e051b74a9db7ae4f03f00.zip |
add __hash__ to InvalidityDate
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 91a07654..d0f4cac9 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -158,6 +158,12 @@ class TestInvalidityDate(object): "<InvalidityDate(invalidity_date=2015-01-01 01:01:00)>" ) + def test_hash(self): + invalid1 = x509.InvalidityDate(datetime.datetime(2015, 1, 1, 1, 1)) + invalid2 = x509.InvalidityDate(datetime.datetime(2015, 1, 1, 1, 1)) + invalid3 = x509.InvalidityDate(datetime.datetime(2015, 1, 1, 1, 2)) + assert hash(invalid1) == hash(invalid2) + assert hash(invalid1) != hash(invalid3) class TestNoticeReference(object): def test_notice_numbers_not_all_int(self): |