From d8e0d8534fb49c23d436716fb445ea7e54e08735 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Sun, 31 Jan 2016 16:46:22 -0330 Subject: Refs #2578 -- implement __hash__ on AccessDescription --- tests/test_x509_ext.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index ff826458..b13405de 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -2228,6 +2228,22 @@ class TestAccessDescription(object): assert ad != ad3 assert ad != object() + def test_hash(self): + ad = x509.AccessDescription( + AuthorityInformationAccessOID.OCSP, + x509.UniformResourceIdentifier(u"http://ocsp.domain.com") + ) + ad2 = x509.AccessDescription( + AuthorityInformationAccessOID.OCSP, + x509.UniformResourceIdentifier(u"http://ocsp.domain.com") + ) + ad3 = x509.AccessDescription( + AuthorityInformationAccessOID.CA_ISSUERS, + x509.UniformResourceIdentifier(u"http://ocsp.domain.com") + ) + assert hash(ad) == hash(ad2) + assert hash(ad) != hash(ad3) + class TestAuthorityInformationAccess(object): def test_invalid_descriptions(self): -- cgit v1.2.3