def test_replace_writes_expected_content(self, mock_open): store = FileEventCursorStore(PROFILE_NAME) store.replace("checkpointname", 123) user_path = path.join(path.expanduser("~"), ".code42cli") path.join(user_path, FILE_EVENT_CHECKPOINT_FOLDER_NAME, PROFILE_NAME, "checkpointname") mock_open.return_value.write.assert_called_once_with("123")
def test_replace_writes_to_expected_file(self, mock_open): store = FileEventCursorStore(PROFILE_NAME) store.replace("checkpointname", 123) user_path = path.join(path.expanduser("~"), ".code42cli") expected_path = path.join( user_path, "file_event_checkpoints", PROFILE_NAME, "checkpointname" ) mock_open.assert_called_once_with(expected_path, "w")