Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_steam_app_from_appmanifest_invalid(self, steam_app_factory):
steam_app = steam_app_factory(name="Fake game", appid=10)
appmanifest_path = \
Path(steam_app.install_path).parent.parent / "appmanifest_10.acf"
appmanifest_path.write_text("invalid")
# Invalid appmanifest file is ignored
assert not SteamApp.from_appmanifest(
path=str(appmanifest_path),
steam_lib_paths=[]
)
def test_steam_app_from_appmanifest(self, steam_app_factory, steam_dir):
"""
Create a SteamApp from an appmanifest file
"""
steam_app = steam_app_factory(name="Fake game", appid=10)
appmanifest_path = \
Path(steam_app.install_path).parent.parent / "appmanifest_10.acf"
steam_app = SteamApp.from_appmanifest(
path=str(appmanifest_path),
steam_lib_paths=[str(steam_dir / "steam" / "steamapps")]
)
assert steam_app.name == "Fake game"
assert steam_app.appid == 10