@mock.patch('certbot._internal.main._delete_if_appropriate')
@mock.patch('certbot._internal.main.client.acme_client')
def test_revoke_with_reason(self, mock_acme_client, mock_delete_if_appropriate):
    mock_delete_if_appropriate.return_value = False
    mock_revoke = mock_acme_client.BackwardsCompatibleClientV2().revoke
    expected = []
    for (reason, code) in constants.REVOCATION_REASONS.items():
        args = 'revoke --cert-path={0} --reason {1}'.format(self.tmp_cert_path, reason).split()
        self._call(args)
        expected.append(mock.call(mock.ANY, code))
        args = 'revoke --cert-path={0} --reason {1}'.format(self.tmp_cert_path, reason.upper()).split()
        self._call(args)
        expected.append(mock.call(mock.ANY, code))
    self.assertEqual(expected, mock_revoke.call_args_list)
@mock.patch('certbot._internal.main._delete_if_appropriate')
@mock.patch('certbot._internal.main.client.acme_client')
def test_revoke_with_reason(self, mock_acme_client, mock_delete_if_appropriate):
    mock_delete_if_appropriate.return_value = False
    mock_revoke = mock_acme_client.BackwardsCompatibleClientV2().revoke
    expected = []
    for (reason, code) in constants.REVOCATION_REASONS.items():
        args = 'revoke --cert-path={0} --reason {1}'.format(self.tmp_cert_path, reason).split()
        self._call(args)
        expected.append(mock.call(mock.ANY, code))
        args = 'revoke --cert-path={0} --reason {1}'.format(self.tmp_cert_path, reason.upper()).split()
        self._call(args)
        expected.append(mock.call(mock.ANY, code))
    self.assertEqual(expected, mock_revoke.call_args_list)