diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-12-26 11:08:25 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-12-26 11:08:25 -0500 |
commit | 0860ef60adc7974dc26cfdd3c7adeb5e4e6e6448 (patch) | |
tree | 8c69e549f05a2512cb66776dfe57428ba105009c /tests/test_x509.py | |
parent | 045fc7ea5e788eaeb2e444985d9dd94280dd6452 (diff) | |
parent | 49bb7565120b181752dc2574cd0e3660393c707c (diff) | |
download | cryptography-0860ef60adc7974dc26cfdd3c7adeb5e4e6e6448.tar.gz cryptography-0860ef60adc7974dc26cfdd3c7adeb5e4e6e6448.tar.bz2 cryptography-0860ef60adc7974dc26cfdd3c7adeb5e4e6e6448.zip |
Merge pull request #2575 from reaperhulk/crlentry-extensions-classes
start switching the CRL entry extensions to be full-fledged classes
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r-- | tests/test_x509.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py index 755b65fa..c91f08ba 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -355,12 +355,12 @@ class TestRevokedCertificate(object): backend ) - exp_issuer = x509.GeneralNames([ + exp_issuer = [ x509.DirectoryName(x509.Name([ x509.NameAttribute(x509.OID_COUNTRY_NAME, u"US"), x509.NameAttribute(x509.OID_COMMON_NAME, u"cryptography.io"), ])) - ]) + ] # First revoked cert doesn't have extensions, test if it is handled # correctly. @@ -383,14 +383,13 @@ class TestRevokedCertificate(object): x509.OID_CRL_REASON).value assert reason == x509.ReasonFlags.unspecified - issuer = rev1.extensions.get_extension_for_oid( - x509.OID_CERTIFICATE_ISSUER).value - assert issuer == exp_issuer + issuer = rev1.extensions.get_extension_for_class( + x509.CertificateIssuer).value + assert issuer == x509.CertificateIssuer(exp_issuer) date = rev1.extensions.get_extension_for_oid( x509.OID_INVALIDITY_DATE).value - assert isinstance(date, datetime.datetime) - assert date.isoformat() == "2015-01-01T00:00:00" + assert date == datetime.datetime(2015, 1, 1, 0, 0) # Check if all reason flags can be found in the CRL. flags = set(x509.ReasonFlags) |