diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_x509.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py index d4a27bc3..ccb24d7f 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -717,6 +717,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): |