chore: typehint tests

This commit is contained in:
aclist committed 2026-11-12 05:10:02 +09:00
1 parent a5374d1f1a
commit e29433b388
23 files changed
+170 -93

No files matched your search

+21 -6
View File
@@ -1,33 +1,48 @@
import pytest
from typing import TYPE_CHECKING
from dzgui.init.migrate import convert_cols_file
from tests.fixtures import fixture_path
if TYPE_CHECKING:
from pathlib import Path
@pytest.fixture
def columns_with_perspective():
def columns_with_perspective() -> "Path":
return fixture_path("columns_1")
@pytest.fixture
def columns_without_perspective():
def columns_without_perspective() -> "Path":
return fixture_path("columns_2")
@pytest.fixture
def columns_with_view():
def columns_with_view() -> "Path":
return fixture_path("columns_3")
@pytest.mark.config
def test_columns_with_perspective(columns_with_perspective):
def test_columns_with_perspective(columns_with_perspective: "Path") -> None:
j = convert_cols_file(columns_with_perspective)
if j is None:
return
assert "View" in j["cols"]
assert "Max" in j["cols"]
@pytest.mark.config
def test_columns_without_perspective(columns_without_perspective):
def test_columns_without_perspective(columns_without_perspective: "Path") -> None:
j = convert_cols_file(columns_without_perspective)
if j is None:
return
assert "View" not in j["cols"]
assert "Max" not in j["cols"]
@pytest.mark.config
def test_columns_with_view(columns_with_view):
def test_columns_with_view(columns_with_view: "Path") -> None:
j = convert_cols_file(columns_with_view)
assert j is None