change: drop debug key

This commit is contained in:
aclist 2026-05-01 20:32:22 +09:00
parent e6d3775fd0
commit 8ec9e5abff
3 changed files with 34 additions and 24 deletions

View File

@ -36,8 +36,8 @@ def rc2json(file: Path) -> str:
d = {}
ips: list[str] = []
toggles = ["auto_install", "debug", "fullscreen"]
deprecated = ["staging_dir", "src_path", "steam_path"]
toggles = ["auto_install", "fullscreen"]
deprecated = ["staging_dir", "src_path", "steam_path", "debug", "branch"]
while True:
tok = lex.get_token()

View File

@ -161,8 +161,6 @@ label_main_menu = "Main menu"
# buttons
ping_servers = "Ping servers"
debug_mode = "Debug mode"
debug_tooltip = "Used to perform a dry run without\n" "actually connecting to a server"
ping_tooltip = (
"Refresh the ping for visible servers.\n" "Available once per unique filter context"
)

View File

@ -8,27 +8,29 @@ from tests.fixtures import fixture_path
pytestmark = pytest.mark.config
@pytest.fixture
def legacy_config():
return fixture_path("dztuirc_one")
@pytest.fixture
def keys():
return [
"bm_api",
"fav_server",
"fav_label",
"name",
"debug",
"branch",
"fullscreen",
"steam_api",
"auto_install",
"default_steam_path",
"client",
"ip_list",
"use_miles"
]
"bm_api",
"fav_server",
"fav_label",
"name",
"branch",
"fullscreen",
"steam_api",
"auto_install",
"default_steam_path",
"client",
"ip_list",
"use_miles",
]
@pytest.fixture
def config():
@ -55,16 +57,18 @@ def test_contains_invalid_values(keys, config):
assert key in keys
@pytest.mark.parametrize("fixture, expect", [
("dztuirc_one", (False, True, True)),
("dztuirc_two", (False, False, False)),
])
@pytest.mark.parametrize(
"fixture, expect",
[
("dztuirc_one", (False, True, True)),
("dztuirc_two", (False, False, False)),
],
)
def test_bool_conversion(fixture, expect):
fixture = fixture_path(fixture)
j = convert.rc2json(fixture)
j = json.loads(j)
assert j["fullscreen"] == expect[0]
assert j["debug"] == expect[1]
assert j["auto_install"] == expect[2]
assert not j["use_miles"]
@ -72,8 +76,16 @@ def test_bool_conversion(fixture, expect):
def test_key_conversion(legacy_config):
j = convert.rc2json(legacy_config)
j = json.loads(j)
keys = ["api_key", "staging_dir", "src_path", "steam_path", "preferred_client"]
keys = [
"api_key",
"staging_dir",
"src_path",
"steam_path",
"preferred_client",
"debug",
]
for key in keys:
assert key not in j
# TODO: test that when a config file is created from scratch, it contains all values