def test_get_custom_library_folders_empty(tmp_path): data = """\ "LibraryFolders" { "TimeNextStatsReport" "1507807583" "ContentStatsID" "313251607278753000" } """ path = tmp_path / "libraryfolders.vdf" path.write_text(dedent(data)) library_folders = get_custom_library_folders(path) assert library_folders == []
def test_get_custom_library_folders(tmp_path): data = """\ "LibraryFolders" { "TimeNextStatsReport" "1507807583" "ContentStatsID" "313251607278753000" "1" "D:\\Steam" "2" "E:\\Games\\Steam" } """ path = tmp_path / "libraryfolders.vdf" path.write_text(dedent(data)) library_folders = get_custom_library_folders(path) assert library_folders == [ os.path.join(r"D:\Steam", "steamapps"), os.path.join(r"E:\Games\Steam", "steamapps") ]
def test_get_custom_library_folders_no_file(tmp_path): path = tmp_path / "libraryfolders.vdf" assert get_custom_library_folders(path) is None
def test_get_custom_library_folders_invalid_file(data, tmp_path): path = tmp_path / "libraryfolders.vdf" path.write_text(dedent(data)) assert get_custom_library_folders(path) is None