def test_delete_when_checkpoint_does_not_exist_raises_cli_error(
     self, mock_open, mock_remove
 ):
     store = FileEventCursorStore(PROFILE_NAME)
     mock_remove.side_effect = FileNotFoundError
     with pytest.raises(Code42CLIError):
         store.delete("deleteme")
示例#2
0
 def test_delete_calls_remove_on_expected_file(self, mock_open,
                                               mock_remove):
     store = FileEventCursorStore(PROFILE_NAME)
     store.delete("deleteme")
     user_path = path.join(path.expanduser("~"), ".code42cli")
     expected_path = path.join(user_path, FILE_EVENT_CHECKPOINT_FOLDER_NAME,
                               PROFILE_NAME, "deleteme")
     mock_remove.assert_called_once_with(expected_path)