@mock.patch('certbot._internal.main._delete_if_appropriate')
@mock.patch('certbot._internal.main.client.acme_client')
def test_revoke_with_key(self, mock_acme_client, mock_delete_if_appropriate):
    mock_delete_if_appropriate.return_value = False
    server = 'foo.bar'
    self._call_no_clientmock(['--cert-path', SS_CERT_PATH, '--key-path', RSA2048_KEY_PATH, '--server', server, 'revoke'])
    with open(RSA2048_KEY_PATH, 'rb') as f:
        mock_acme_client.BackwardsCompatibleClientV2.assert_called_once_with(mock.ANY, jose.JWK.load(f.read()), server)
    with open(SS_CERT_PATH, 'rb') as f:
        cert = crypto_util.pyopenssl_load_certificate(f.read())[0]
        mock_revoke = mock_acme_client.BackwardsCompatibleClientV2().revoke
        mock_revoke.assert_called_once_with(jose.ComparableX509(cert), mock.ANY)
@mock.patch('certbot._internal.main._delete_if_appropriate')
@mock.patch('certbot._internal.main.client.acme_client')
def test_revoke_with_key(self, mock_acme_client, mock_delete_if_appropriate):
    mock_delete_if_appropriate.return_value = False
    server = 'foo.bar'
    self._call_no_clientmock(['--cert-path', SS_CERT_PATH, '--key-path', RSA2048_KEY_PATH, '--server', server, 'revoke'])
    with open(RSA2048_KEY_PATH, 'rb') as f:
        mock_acme_client.BackwardsCompatibleClientV2.assert_called_once_with(mock.ANY, jose.JWK.load(f.read()), server)
    with open(SS_CERT_PATH, 'rb') as f:
        cert = crypto_util.pyopenssl_load_certificate(f.read())[0]
        mock_revoke = mock_acme_client.BackwardsCompatibleClientV2().revoke
        mock_revoke.assert_called_once_with(jose.ComparableX509(cert), mock.ANY)