예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
 def revoke_cert(self) -> None:
     """
     Revoke a certificate
     """
     DojotAPI.revoke_certificate(self.jwt, self.crt["fingerprint"])