Compare commits

..
Author SHA1 Message Date
aclist b83a333cea chore: update test 2026-10-26 19:42:03 +09:00
2 changed files with 5 additions and 50 deletions

No files matched your search

+5 -3
View File
@@ -1,7 +1,7 @@
import configparser
import pytest
from dzgui.const.constants import FLATPAK_APPID, GTK_APP_ID
from dzgui.const.constants import FLATPAK_APPID, GTK_APP_ID, TMP_PATH
from dzgui.config.xdg import get_xdg_paths
from dzgui.util.flatpak import apply_overrides
@@ -38,6 +38,8 @@ def test_session_bus(override, config) -> None:
def test_paths(override, xdg_paths, config) -> None:
expect = xdg_paths
expect: list[str] = []
expect.append(TMP_PATH)
expect.extend([*xdg_paths.values()])
paths = config[PATHS_KEY][PATHS_SUBKEY].split(";")
assert all(str(path) in paths for path in expect.values())
assert all(str(path) in paths for path in expect)
-47
View File
@@ -1,47 +0,0 @@
import pytest
from dzgui.model.model_factory import FastInsertListStore
@pytest.fixture
def heterogeneous_list() -> None:
return [["a", 0, True], ["b", 1, False]]
@pytest.fixture
def mismatched_length_list() -> None:
return [["a", 0, True], ["b", 1, False, 0]]
@pytest.fixture
def extended_list(heterogeneous_list) -> None:
fs = FastInsertListStore(str, int, bool)
fs.extend(heterogeneous_list)
return fs
@pytest.fixture
def appended_list(heterogeneous_list) -> None:
fs = FastInsertListStore(str, int, bool)
for row in heterogeneous_list:
fs.append(row)
return fs
@pytest.mark.parametrize("target", ["extended_list", "appended_list"])
def test_list_parity(heterogeneous_list, request, target) -> None:
target = request.getfixturevalue(target)
extracted = [[el for el in row] for row in target]
assert heterogeneous_list == extracted
def test_type_disparity(heterogeneous_list) -> None:
with pytest.raises(TypeError):
fs = FastInsertListStore(str, bool, bool)
fs.extend(heterogeneous_list)
def test_length_disparity(mismatched_length_list) -> None:
with pytest.raises(ValueError):
fs = FastInsertListStore(str, int, bool)
fs.extend(mismatched_length_list)