mirror of
https://github.com/aclist/dztui.git
synced 2026-10-28 13:42:42 +01:00
change: drop debug key
This commit is contained in:
1 parent
e6d3775fd0
commit
8ec9e5abff
3 files changed
+34
-24
No files matched your search
+32
-20
@@ -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
|
||||
Reference in new issue
Block a user