mirror of
https://github.com/aclist/dztui.git
synced 2026-10-29 06:02:51 +01:00
fix: handle alternate client versions when parsing vdf
This commit is contained in:
1 parent
bbaec35a5f
commit
6a30ed44fc
7 files changed
+112
-20
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import pytest
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from dzgui.api.steam import find_user_id
|
||||
from tests.fixtures import fixture_path
|
||||
|
||||
pytestmark = pytest.mark.apitest
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"fixture, expect",
|
||||
[
|
||||
("api/loginusers_legacy_client.vdf", 0),
|
||||
("api/loginusers_legacy_client_multiple.vdf", 1),
|
||||
("api/loginusers_beta_client.vdf", 0),
|
||||
],
|
||||
)
|
||||
def test_loginusers(monkeypatch, fixture: str, expect: int) -> None:
|
||||
def mock_loginusers(path: Path) -> Path:
|
||||
return fixture_path(fixture)
|
||||
|
||||
monkeypatch.setattr("dzgui.api.steam.find_loginusers", mock_loginusers)
|
||||
uid = find_user_id(Path(""))
|
||||
assert int(uid) == expect
|
||||
Reference in new issue
Block a user