From 7638c3151ccbc17ff1adee0384b1fa10530cf87c Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 26 Nov 2014 11:13:31 -1000 Subject: improve x509 load error handling --- tests/test_x509.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/test_x509.py b/tests/test_x509.py index 0a120eba..1e1bde1d 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -103,3 +103,11 @@ class TestX509Certificate(object): ) ) assert cert.version == x509.X509Version.v1 + + def test_invalid_pem(self, backend): + with pytest.raises(ValueError): + x509.load_pem_x509_certificate(b"notacert", backend) + + def test_invalid_der(self, backend): + with pytest.raises(ValueError): + x509.load_der_x509_certificate(b"notacert", backend) -- cgit v1.2.3