aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-05-17 12:46:01 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-05-17 12:46:01 -0400
commitb0391810fb74bd098592b03ffbb937daeed4561f (patch)
tree78ead3d4dfba1ef16bf661913da60c36482100f9 /tests
parent4825b9ed835866b50a0cc3feb9fad9bc81d57ec1 (diff)
parent58e870ca8ac61e4099fb9d5d9e10820d338f8671 (diff)
downloadcryptography-b0391810fb74bd098592b03ffbb937daeed4561f.tar.gz
cryptography-b0391810fb74bd098592b03ffbb937daeed4561f.tar.bz2
cryptography-b0391810fb74bd098592b03ffbb937daeed4561f.zip
Merge pull request #1968 from reaperhulk/ext-eq
x509 extension equality
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509_ext.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index 72f2f9e4..572aa30c 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -38,6 +38,33 @@ class TestExtension(object):
"_length=None)>)>"
)
+ def test_eq(self):
+ ext1 = x509.Extension(
+ x509.ObjectIdentifier('1.2.3.4'), False, 'value'
+ )
+ ext2 = x509.Extension(
+ x509.ObjectIdentifier('1.2.3.4'), False, 'value'
+ )
+ assert ext1 == ext2
+
+ def test_ne(self):
+ ext1 = x509.Extension(
+ x509.ObjectIdentifier('1.2.3.4'), False, 'value'
+ )
+ ext2 = x509.Extension(
+ x509.ObjectIdentifier('1.2.3.5'), False, 'value'
+ )
+ ext3 = x509.Extension(
+ x509.ObjectIdentifier('1.2.3.4'), True, 'value'
+ )
+ ext4 = x509.Extension(
+ x509.ObjectIdentifier('1.2.3.4'), False, 'value4'
+ )
+ assert ext1 != ext2
+ assert ext1 != ext3
+ assert ext1 != ext4
+ assert ext1 != object()
+
class TestNoticeReference(object):
def test_notice_numbers_not_all_int(self):