aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-05-13 13:17:12 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-05-13 13:17:12 -0400
commit3325b0e9d525ec9861b5eba57e14fe9548e6dcde (patch)
tree0ca65c324ad46a51d44a2062e36c8e5db644062a /tests/test_x509_ext.py
parent3fa86454cc94053abc976bf992604eb0ab7c7d56 (diff)
parent58cc3973cf3c3e83d5cb9e1d29e1a4fd9b88eff7 (diff)
downloadcryptography-3325b0e9d525ec9861b5eba57e14fe9548e6dcde.tar.gz
cryptography-3325b0e9d525ec9861b5eba57e14fe9548e6dcde.tar.bz2
cryptography-3325b0e9d525ec9861b5eba57e14fe9548e6dcde.zip
Merge pull request #1943 from reaperhulk/san-eq
add eq/ne support to SubjectAlternativeName
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r--tests/test_x509_ext.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index e1312b6c..15f06664 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -1128,6 +1128,25 @@ class TestSubjectAlternativeName(object):
"<SubjectAlternativeName([<DNSName(value=cryptography.io)>])>"
)
+ def test_eq(self):
+ san = x509.SubjectAlternativeName(
+ [x509.DNSName(u"cryptography.io")]
+ )
+ san2 = x509.SubjectAlternativeName(
+ [x509.DNSName(u"cryptography.io")]
+ )
+ assert san == san2
+
+ def test_ne(self):
+ san = x509.SubjectAlternativeName(
+ [x509.DNSName(u"cryptography.io")]
+ )
+ san2 = x509.SubjectAlternativeName(
+ [x509.RFC822Name(u"admin@cryptography.io")]
+ )
+ assert san != san2
+ assert san != object()
+
@pytest.mark.requires_backend_interface(interface=RSABackend)
@pytest.mark.requires_backend_interface(interface=X509Backend)