diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-01-03 16:17:14 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-01-03 16:17:14 -0600 |
commit | 743a213d33ad8b1a2ef0becd0084c3fceebac8dd (patch) | |
tree | dfc55e480a2ac9b840038d82d6cab82e4a243715 /tests/test_x509_ext.py | |
parent | b6a0f24434da2cab3e1bba0eb7ba064ca5aacec7 (diff) | |
parent | d1b5681f6db2bde7a14625538bd7907b08dfb486 (diff) | |
download | cryptography-743a213d33ad8b1a2ef0becd0084c3fceebac8dd.tar.gz cryptography-743a213d33ad8b1a2ef0becd0084c3fceebac8dd.tar.bz2 cryptography-743a213d33ad8b1a2ef0becd0084c3fceebac8dd.zip |
Merge pull request #2636 from alex/uri-hash
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): |