def test_local_games_list_no_registry(mock_get_library_folders, mock_get_installed_games, mock_get_app_states_from_registry): library_folders = ["cofiguration_path"] mock_get_library_folders.return_value = library_folders mock_get_installed_games.return_value = ["1513", "12351"] mock_get_app_states_from_registry.return_value = {} assert local_games_list() == []
def test_local_games_list_no_games(mock_get_library_folders, mock_get_installed_games, mock_get_app_states_from_registry): library_folders = ["cofiguration_path"] mock_get_library_folders.return_value = library_folders mock_get_installed_games.return_value = [] mock_get_app_states_from_registry.return_value = {} assert local_games_list() == [] mock_get_library_folders.assert_called_once_with() mock_get_installed_games.assert_called_once_with(library_folders) mock_get_app_states_from_registry.assert_called_once()
def test_local_games_list(mock_get_library_folders, mock_get_installed_games, mock_get_app_states_from_registry): library_folders = ["cofiguration_path"] mock_get_library_folders.return_value = library_folders mock_get_installed_games.return_value = ["1513", "12351"] mock_get_app_states_from_registry.return_value = { "1513": LocalGameState.Installed, "12351": LocalGameState.Installed | LocalGameState.Running, "89123": LocalGameState.Installed } assert local_games_list() == [ LocalGame("1513", LocalGameState.Installed), LocalGame("12351", LocalGameState.Installed | LocalGameState.Running) ]
def test_local_games_list_no_steam(mocker): get_library_folders = mocker.patch("client.get_library_folders") get_library_folders.return_value = [] assert local_games_list() == [] get_library_folders.assert_called_once_with()