From 396a282fd5febabe382dcdacf4e8a6c2395f0087 Mon Sep 17 00:00:00 2001 From: Erik Trauschke Date: Mon, 28 Sep 2015 08:56:18 -0700 Subject: use openssl assert change _build* to _decode* make CRLs into iterators various fixes --- tests/test_x509.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_x509.py b/tests/test_x509.py index f5fead53..c380b860 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -232,12 +232,15 @@ class TestRevokedCertificate(object): assert rev1.get_invalidity_date().isoformat() == "2015-01-01T00:00:00" # Check if all reason flags can be found in the CRL. + # Also test if CRL as iterator works. flags = set(x509.ReasonFlags) - # The first revoked cert doesn't have a reason. - for r in crl.revoked_certificates[1:]: + for r in crl: flags.discard(r.get_reason()) assert len(flags) == 0 + # Check that len() works for CRLs. + assert len(crl) == 12 + def test_duplicate_entry_ext(self, backend): crl = _load_cert( os.path.join("x509", "custom", "crl_dup_entry_ext.pem"), -- cgit v1.2.3