From d1b5681f6db2bde7a14625538bd7907b08dfb486 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 3 Jan 2016 15:14:34 -0500 Subject: Implement __hash__ on UniformResourceIdentifier --- tests/test_x509_ext.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/test_x509_ext.py') diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 03a3730a..d04ce757 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -1480,6 +1480,14 @@ class TestUniformResourceIdentifier(object): ) assert gn.value == u"ldap://cryptography:90/path?query=true#somedata" + def test_hash(self): + g1 = x509.UniformResourceIdentifier(u"http://host.com") + g2 = x509.UniformResourceIdentifier(u"http://host.com") + g3 = x509.UniformResourceIdentifier(u"http://other.com") + + assert hash(g1) == hash(g2) + assert hash(g1) != hash(g3) + class TestRegisteredID(object): def test_not_oid(self): -- cgit v1.2.3