diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-17 09:15:30 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-17 09:15:30 -0700 |
commit | 58e870ca8ac61e4099fb9d5d9e10820d338f8671 (patch) | |
tree | 1c7d802851d417a675740bbd2b2492d70463929d /tests | |
parent | ad9d46ee7f9a7f74ee9a0345fe1c60fb8c49dcaf (diff) | |
download | cryptography-58e870ca8ac61e4099fb9d5d9e10820d338f8671.tar.gz cryptography-58e870ca8ac61e4099fb9d5d9e10820d338f8671.tar.bz2 cryptography-58e870ca8ac61e4099fb9d5d9e10820d338f8671.zip |
x509 extension equality
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_x509_ext.py | 27 |
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): |