mirror of
https://github.com/aclist/dztui.git
synced 2026-11-21 17:09:30 +01:00
This commit is contained in:
1 parent
97c90b435b
commit
a3068324fa
2 files changed
+42
No files matched your search
+12
@@ -0,0 +1,12 @@
|
|||||||
|
"libraryfolders"
|
||||||
|
{
|
||||||
|
"0"
|
||||||
|
{
|
||||||
|
"path" ""
|
||||||
|
"label" ""
|
||||||
|
"apps"
|
||||||
|
{
|
||||||
|
"221100" "11111"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import pytest
|
||||||
|
import vdf
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from dzgui.api.mods import get_local_mod_ids
|
||||||
|
from dzgui.util.dirs import make_parents
|
||||||
|
from tests.fixtures import fixture_path
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def libraryfolders() -> Path:
|
||||||
|
return fixture_path("api/steamapps/libraryfolders.vdf")
|
||||||
|
|
||||||
|
def test_missing_mod_dir(tmp_path, libraryfolders: Path) -> None:
|
||||||
|
"""
|
||||||
|
Updates fixture file key with tmp path value serializes to file,
|
||||||
|
then tests for missing mod directory returning an empty list
|
||||||
|
"""
|
||||||
|
folders = tmp_path.joinpath("steamapps/libraryfolders.vdf")
|
||||||
|
workshop = tmp_path.joinpath("steamapps/workshop/content")
|
||||||
|
make_parents(folders)
|
||||||
|
make_parents(workshop, descend=True)
|
||||||
|
|
||||||
|
with open(libraryfolders, "r") as f:
|
||||||
|
data = vdf.load(f)
|
||||||
|
data["libraryfolders"]["0"]["path"] = tmp_path
|
||||||
|
with open(folders, "w") as f:
|
||||||
|
vdf.dump(data, f, pretty=True)
|
||||||
|
ids = get_local_mod_ids(tmp_path)
|
||||||
|
assert len(ids) == 0
|
||||||
Reference in new issue
Block a user