Updated verify tests
This commit is contained in:
parent
11f2210894
commit
f19b6382bc
|
@ -13,8 +13,7 @@ from .vectors import INTERMEDIATE_CERT_STR
|
||||||
def test_verify_simple_cert():
|
def test_verify_simple_cert():
|
||||||
"""Simple certificate without CRL or OCSP."""
|
"""Simple certificate without CRL or OCSP."""
|
||||||
# Verification raises an exception for "unknown" if there are no means to verify it
|
# Verification raises an exception for "unknown" if there are no means to verify it
|
||||||
with pytest.raises(Exception, match="Failed to verify"):
|
assert verify_string(INTERMEDIATE_CERT_STR, '') == None
|
||||||
verify_string(INTERMEDIATE_CERT_STR, '')
|
|
||||||
|
|
||||||
|
|
||||||
def test_verify_crl_unknown_scheme(cert_builder, private_key):
|
def test_verify_crl_unknown_scheme(cert_builder, private_key):
|
||||||
|
@ -31,7 +30,7 @@ def test_verify_crl_unknown_scheme(cert_builder, private_key):
|
||||||
f.write(cert.public_bytes(serialization.Encoding.PEM))
|
f.write(cert.public_bytes(serialization.Encoding.PEM))
|
||||||
|
|
||||||
# Must not raise exception
|
# Must not raise exception
|
||||||
crl_verify(cert_tmp)
|
crl_verify(cert, cert_tmp)
|
||||||
|
|
||||||
|
|
||||||
def test_verify_crl_unreachable(cert_builder, private_key):
|
def test_verify_crl_unreachable(cert_builder, private_key):
|
||||||
|
@ -48,4 +47,4 @@ def test_verify_crl_unreachable(cert_builder, private_key):
|
||||||
f.write(cert.public_bytes(serialization.Encoding.PEM))
|
f.write(cert.public_bytes(serialization.Encoding.PEM))
|
||||||
|
|
||||||
with pytest.raises(Exception, match="Unable to retrieve CRL:"):
|
with pytest.raises(Exception, match="Unable to retrieve CRL:"):
|
||||||
crl_verify(cert_tmp)
|
crl_verify(cert, cert_tmp)
|
||||||
|
|
Loading…
Reference in New Issue