diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-11-26 11:13:31 -1000 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-12-15 15:49:48 -0600 |
commit | 7638c3151ccbc17ff1adee0384b1fa10530cf87c (patch) | |
tree | 6bdeee007fe53cee97da023f211cbcf9b4bd42b5 /tests | |
parent | 30c5ccdfb505e33dcdaa7f248c3479e3050a70da (diff) | |
download | cryptography-7638c3151ccbc17ff1adee0384b1fa10530cf87c.tar.gz cryptography-7638c3151ccbc17ff1adee0384b1fa10530cf87c.tar.bz2 cryptography-7638c3151ccbc17ff1adee0384b1fa10530cf87c.zip |
improve x509 load error handling
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_x509.py | 8 |
1 files changed, 8 insertions, 0 deletions
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) |