diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-13 09:57:09 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-13 09:57:09 -0500 |
commit | 8565f5ed4e76dbb9ff46cc9c112aa0eb6b259186 (patch) | |
tree | 225bda4cc0401c0925a179bd9384c9d22e2f4ee6 /tests/test_x509_ext.py | |
parent | 91ea3a91fe67ecf2577b3f88955c4baad4d4f131 (diff) | |
download | cryptography-8565f5ed4e76dbb9ff46cc9c112aa0eb6b259186.tar.gz cryptography-8565f5ed4e76dbb9ff46cc9c112aa0eb6b259186.tar.bz2 cryptography-8565f5ed4e76dbb9ff46cc9c112aa0eb6b259186.zip |
add eq/ne support to KeyUsage
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 2852776b..e1312b6c 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -463,6 +463,57 @@ class TestKeyUsage(object): "only=False)>" ) + def test_eq(self): + ku = x509.KeyUsage( + digital_signature=False, + content_commitment=False, + key_encipherment=False, + data_encipherment=False, + key_agreement=True, + key_cert_sign=False, + crl_sign=False, + encipher_only=False, + decipher_only=True + ) + ku2 = x509.KeyUsage( + digital_signature=False, + content_commitment=False, + key_encipherment=False, + data_encipherment=False, + key_agreement=True, + key_cert_sign=False, + crl_sign=False, + encipher_only=False, + decipher_only=True + ) + assert ku == ku2 + + def test_ne(self): + ku = x509.KeyUsage( + digital_signature=False, + content_commitment=False, + key_encipherment=False, + data_encipherment=False, + key_agreement=True, + key_cert_sign=False, + crl_sign=False, + encipher_only=False, + decipher_only=True + ) + ku2 = x509.KeyUsage( + digital_signature=False, + content_commitment=False, + key_encipherment=False, + data_encipherment=False, + key_agreement=False, + key_cert_sign=False, + crl_sign=False, + encipher_only=False, + decipher_only=False + ) + assert ku != ku2 + assert ku != object() + class TestSubjectKeyIdentifier(object): def test_properties(self): |