aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-25 16:17:40 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-25 20:19:17 -0600
commit49bb7565120b181752dc2574cd0e3660393c707c (patch)
tree719427d25f47ae295dd44f6707d83cc8333b859d /tests/test_x509.py
parent4f76921ad87d71067158625aa0afedbba8ae1314 (diff)
downloadcryptography-49bb7565120b181752dc2574cd0e3660393c707c.tar.gz
cryptography-49bb7565120b181752dc2574cd0e3660393c707c.tar.bz2
cryptography-49bb7565120b181752dc2574cd0e3660393c707c.zip
start switching the CRL entry extensions to be full-fledged classes
first up: CertificateIssuer
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r--tests/test_x509.py13
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)