diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-01-03 15:14:34 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2016-01-03 15:14:34 -0500 |
commit | d1b5681f6db2bde7a14625538bd7907b08dfb486 (patch) | |
tree | a432fcde6a5396e198aa44e1b5016395905c7e52 /tests/test_x509_ext.py | |
parent | a39a23c6c18aaa01165c6c67b9c715405b259a54 (diff) | |
download | cryptography-d1b5681f6db2bde7a14625538bd7907b08dfb486.tar.gz cryptography-d1b5681f6db2bde7a14625538bd7907b08dfb486.tar.bz2 cryptography-d1b5681f6db2bde7a14625538bd7907b08dfb486.zip |
Implement __hash__ on UniformResourceIdentifier
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 8 |
1 files changed, 8 insertions, 0 deletions
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): |