Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Ensure the Steam directory is found when using STEAM_DIR env var
and when both runtime and steamapps directories exist inside
the path
"""
custom_path = tmp_path / "custom_steam"
custom_path.mkdir()
monkeypatch.setenv("STEAM_DIR", str(custom_path))
os.rename(
str(steam_dir / "steamapps"),
str(custom_path / "steamapps")
)
# The path isn't valid yet
assert find_steam_path() == (None, None)
os.rename(
str(steam_root / "ubuntu12_32"),
str(custom_path / "ubuntu12_32")
)
assert find_steam_path() == (str(custom_path), str(custom_path))