aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-07-08 20:59:16 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-07-08 20:59:16 -0400
commit978137d89e99314e823ab206d482d23e6a830329 (patch)
treedb7255ef8add97cc87ef32552d0084c8bc1e7744 /tests/test_x509.py
parent366b0f8385bc1a35c25a4316f315c33a84348261 (diff)
downloadcryptography-978137d89e99314e823ab206d482d23e6a830329.tar.gz
cryptography-978137d89e99314e823ab206d482d23e6a830329.tar.bz2
cryptography-978137d89e99314e823ab206d482d23e6a830329.zip
Fixed #2127 -- added __hash__ to CSR
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r--tests/test_x509.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index ccb24d7f..9c97e969 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -746,6 +746,26 @@ class TestRSACertificateRequest(object):
assert request1 != request2
assert request1 != object()
+ def test_hash(self, backend):
+ request1 = _load_cert(
+ os.path.join("x509", "requests", "rsa_sha1.pem"),
+ x509.load_pem_x509_csr,
+ backend
+ )
+ request2 = _load_cert(
+ os.path.join("x509", "requests", "rsa_sha1.pem"),
+ x509.load_pem_x509_csr,
+ backend
+ )
+ request3 = _load_cert(
+ os.path.join("x509", "requests", "san_rsa_sha1.pem"),
+ x509.load_pem_x509_csr,
+ backend
+ )
+
+ assert hash(request1) == hash(request2)
+ assert hash(request1) != hash(request3)
+
@pytest.mark.requires_backend_interface(interface=X509Backend)
class TestCertificateSigningRequestBuilder(object):