Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
steam_library_factory):
"""
Find the proton prefix directory for a game located inside
a "SteamApps" directory instead of the default "steamapps".
Regression test for #33.
"""
library_dir = steam_library_factory("TestLibrary")
steam_app_factory(name="Test game", appid=10, library_dir=library_dir)
os.rename(
str(library_dir / "steamapps"),
str(library_dir / "SteamApps")
)
path = find_appid_proton_prefix(
appid=10, steam_lib_paths=[str(steam_dir), str(library_dir)]
)
assert path == str(
library_dir / "SteamApps" / "compatdata" / "10" / "pfx"
)
# Give the copy in library B the most recent modification timestamp
os.utime(
str(library_dir_a / "steamapps" / "compatdata" / "10" / "pfx.lock"),
(time.time() - 100, time.time() - 100)
)
os.utime(
str(library_dir_b / "steamapps" / "compatdata" / "10" / "pfx.lock"),
(time.time() - 25, time.time() - 25)
)
os.utime(
str(library_dir_c / "steamapps" / "compatdata" / "10" / "pfx.lock"),
(time.time() - 50, time.time() - 50)
)
path = find_appid_proton_prefix(
appid=10,
steam_lib_paths=[
str(library_dir_a), str(library_dir_b), str(library_dir_c)
]
)
assert path == str(
library_dir_b / "steamapps" / "compatdata" / "10" / "pfx"
)