diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-01-03 15:12:23 -0500 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2016-01-03 15:12:23 -0500 |
| commit | b642deed88a8696e5f01ce6855ccf89985fc35d0 (patch) | |
| tree | 2fab837d66c674ae9d23a372e1b5f8a55437e26d /tests | |
| parent | a39a23c6c18aaa01165c6c67b9c715405b259a54 (diff) | |
| download | cryptography-b642deed88a8696e5f01ce6855ccf89985fc35d0.tar.gz cryptography-b642deed88a8696e5f01ce6855ccf89985fc35d0.tar.bz2 cryptography-b642deed88a8696e5f01ce6855ccf89985fc35d0.zip | |
Implement __hash__ on RFC822Name
Diffstat (limited to 'tests')
| -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..450f192d 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -1448,6 +1448,14 @@ class TestRFC822Name(object): assert gn.value == u"email@em\xe5\xefl.com" assert gn._encoded == b"email@xn--eml-vla4c.com" + def test_hash(self): + g1 = x509.RFC822Name(u"email@host.com") + g2 = x509.RFC822Name(u"email@host.com") + g3 = x509.RFC822Name(u"admin@host.com") + + assert hash(g1) == hash(g2) + assert hash(g1) != hash(g3) + class TestUniformResourceIdentifier(object): def test_no_parsed_hostname(self): |
