def test_revoke_certificate(self, mock_requests): """ Should revoke the certificate correctly. """ DojotAPI.revoke_certificate(self.jwt, self.crt['fingerprint']) DojotAPI.call_api.assert_called_once_with(mock_requests.delete, self.args, False)
def test_revoke_certificate_exception(self, mock_requests): """ Should not generate cert, because rose an exception. """ DojotAPI.call_api.side_effect = APICallError() with self.assertRaises(Exception) as context: DojotAPI.revoke_certificate(self.jwt, self.crt['fingerprint']) self.assertIsNotNone(context.exception) self.assertIsInstance(context.exception, APICallError) DojotAPI.call_api.assert_called_once_with(mock_requests.delete, self.args, False)
def revoke_cert(self) -> None: """ Revoke a certificate """ DojotAPI.revoke_certificate(self.jwt, self.crt["fingerprint"])