aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-07-07 16:42:45 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-07-07 16:42:45 -0500
commit28ab45482ec35b9ce417352151cac9b213bae6f2 (patch)
treef83747b0dff288127fcf66ac22960d4ef46bdbf2 /tests/test_x509.py
parent11bd1a13627098468707177a1e1fddfc92601ff3 (diff)
parenteb2df546027650469768c9ad1571df96e423206a (diff)
downloadcryptography-28ab45482ec35b9ce417352151cac9b213bae6f2.tar.gz
cryptography-28ab45482ec35b9ce417352151cac9b213bae6f2.tar.bz2
cryptography-28ab45482ec35b9ce417352151cac9b213bae6f2.zip
Merge pull request #2126 from alex/csr-eq
Fixed #2121 -- added __eq__ and __ne__ to CSRs
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r--tests/test_x509.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index 90b3fe5f..80ae0a22 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -694,6 +694,35 @@ class TestRSACertificateRequest(object):
serialized = request.public_bytes(encoding)
assert serialized == request_bytes
+ def test_eq(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
+ )
+
+ assert request1 == request2
+
+ def test_ne(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", "san_rsa_sha1.pem"),
+ x509.load_pem_x509_csr,
+ backend
+ )
+
+ assert request1 != request2
+ assert request1 != object()
+
@pytest.mark.requires_backend_interface(interface=X509Backend)
class TestCertificateSigningRequestBuilder(object):