def test_delete_calls_remove_on_expected_file(self, mock_open, mock_remove): store = AuditLogCursorStore(PROFILE_NAME) store.delete("deleteme") user_path = path.join(path.expanduser("~"), ".code42cli") expected_path = path.join(user_path, AUDIT_LOG_CHECKPOINT_FOLDER_NAME, PROFILE_NAME, "deleteme") mock_remove.assert_called_once_with(expected_path)
def test_delete_when_checkpoint_does_not_exist_raises_cli_error( self, mock_open, mock_remove): store = AuditLogCursorStore(PROFILE_NAME) mock_remove.side_effect = FileNotFoundError with pytest.raises(Code42CLIError): store.delete("deleteme")