diff options
Diffstat (limited to 'tests/test_crypto.py')
-rw-r--r-- | tests/test_crypto.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_crypto.py b/tests/test_crypto.py index ea89f6c..8c19030 100644 --- a/tests/test_crypto.py +++ b/tests/test_crypto.py @@ -1968,6 +1968,14 @@ class TestX509(_PKeyInteractionTestsMixin): cert.gmtime_adj_notAfter(2) assert not cert.has_expired() + def test_has_expired_exception(self): + """ + `X509.has_expired` throws ValueError if not-after time is not set + """ + cert = X509() + with pytest.raises(ValueError): + cert.has_expired() + def test_root_has_not_expired(self): """ `X509.has_expired` returns `False` if the certificate's not-after time |