mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-23 10:26:19 +01:00
Wraps depotdownloader for the bulk content pull (bypasses Steam's own capped download speed) and steamcmd's app_update --validate to make Steam recognize the result, with a manual-manifest fallback for the confirmed steamcmd install-script segfault bug when no fix is available. Name search via store.steampowered.com is best-effort since that endpoint TLS-rejects scripted clients on this network; --appid plus steamcmd's own app_info_print is the reliable primary path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
69 lines
1.2 KiB
Python
69 lines
1.2 KiB
Python
from steam_installer import vdf
|
|
|
|
|
|
def test_parse_flat_block():
|
|
text = """
|
|
"AppState"
|
|
{
|
|
"appid" "1771300"
|
|
"name" "Kingdom Come: Deliverance II"
|
|
}
|
|
"""
|
|
result = vdf.parse(text)
|
|
assert result == {
|
|
"AppState": {
|
|
"appid": "1771300",
|
|
"name": "Kingdom Come: Deliverance II",
|
|
}
|
|
}
|
|
|
|
|
|
def test_parse_nested_blocks():
|
|
text = """
|
|
"AppState"
|
|
{
|
|
"InstalledDepots"
|
|
{
|
|
"1771302"
|
|
{
|
|
"manifest" "257127247679847518"
|
|
"size" "199419496"
|
|
}
|
|
}
|
|
}
|
|
"""
|
|
result = vdf.parse(text)
|
|
assert (
|
|
result["AppState"]["InstalledDepots"]["1771302"]["manifest"]
|
|
== "257127247679847518"
|
|
)
|
|
|
|
|
|
def test_parse_handles_comments_and_blank_lines():
|
|
text = """
|
|
// leading comment
|
|
"AppState"
|
|
{
|
|
|
|
"appid" "1" // trailing comment
|
|
}
|
|
"""
|
|
result = vdf.parse(text)
|
|
assert result == {"AppState": {"appid": "1"}}
|
|
|
|
|
|
def test_roundtrip_dumps_then_parse():
|
|
data = {
|
|
"appid": "1771300",
|
|
"InstalledDepots": {
|
|
"1771302": {"manifest": "257127247679847518", "size": "199419496"},
|
|
},
|
|
}
|
|
text = vdf.dumps("AppState", data)
|
|
reparsed = vdf.parse(text)
|
|
assert reparsed == {"AppState": data}
|
|
|
|
|
|
def test_empty_input_returns_empty_dict():
|
|
assert vdf.parse("") == {}
|