This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/test_certificate_ops.py b/tests/test_certificate_ops.py | |
index 852a9e5..bb29550 100644 | |
--- a/tests/test_certificate_ops.py | |
+++ b/tests/test_certificate_ops.py | |
@@ -128,9 +128,9 @@ class CertificateOpsTests(unittest.TestCase): | |
data = {'validators': validators} | |
with mock.patch.dict(config, data): | |
- with self.assertRaises(http_status.HTTPException) as cm: | |
+ with self.assertRaises(http_status.HTTPException): | |
certificate_ops.validate_csr(None, csr_obj, None) | |
- self.assertEqual(cm.exception.code, 400) | |
+ self.assertRaises(http_status.HTTPBadRequest) | |
def test_ca_cert_read_failure(self): | |
"""Test CA certificate read failure.""" | |
@@ -140,9 +140,9 @@ class CertificateOpsTests(unittest.TestCase): | |
'key_path': 'tests/CA/root-ca-unwrapped.key'}} | |
with mock.patch.dict(config, data): | |
- with self.assertRaises(http_status.HTTPException) as cm: | |
+ with self.assertRaises(http_status.HTTPException): | |
certificate_ops.sign(csr_obj) | |
- self.assertEqual(cm.exception.code, 500) | |
+ self.assertRaises(http_status.HTTPInternalServerError) | |
def test_ca_key_read_failure(self): | |
"""Test CA key read failure.""" | |
@@ -152,6 +152,6 @@ class CertificateOpsTests(unittest.TestCase): | |
'key_path': '/xxx/not/a/valid/path'}} | |
with mock.patch.dict(config, data): | |
- with self.assertRaises(http_status.HTTPException) as cm: | |
+ with self.assertRaises(http_status.HTTPException): | |
certificate_ops.sign(csr_obj) | |
- self.assertEqual(cm.exception.code, 500) | |
+ self.assertRaises(http_status.HTTPInternalServerError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment