def test_delete_files_location( tmpdir, games_path_exist: bool, backup_path_exist: bool, ): # Setup data_dir = Path(str(tmpdir.join("user_data_dir"))) options = Options(data_dir) game_files = tmpdir.join("user_data_dir", "extracted_game") if games_path_exist: game_files.ensure_dir() game_files.join("random.txt").write_text("yay", "utf-8") backup_files = tmpdir.join("user_data_dir", "backup") if backup_path_exist: backup_files.ensure_dir() backup_files.join("random.txt").write_text("yay", "utf-8") # Run simplified_patcher.delete_files_location(options) # Assert assert not game_files.exists() assert not backup_files.exists()
def _on_input_file_button(self): if self._has_game: simplified_patcher.delete_files_location(self._options) self.input_file_edit.setText("") self.check_extracted_game() else: input_file = common_qt_lib.prompt_user_for_input_iso(self) if input_file is not None: self.input_file_edit.setText(str(input_file.absolute()))
def delete_loaded_game(self): simplified_patcher.delete_files_location(self._options) self.loaded_game_updated.emit()