From 67cde769bd98f701e88e051b74a9db7ae4f03f00 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 26 Dec 2015 11:37:14 -0600 Subject: add __hash__ to InvalidityDate --- tests/test_x509_ext.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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): "" ) + 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): -- cgit v1.2.3