refactor target

add error test for ValueError

test badges updated

patch bump
This commit is contained in:
2023-08-09 17:03:55 +01:00
parent 69472a783e
commit 763e44df12
6 changed files with 31 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ class TestErrors:
):
vban_cmd.api("unknown_kind")
def test_it_tests_an_invalid_config(self):
def test_it_tests_an_unknown_config_name(self):
EXPECTED_MSG = (
f"No config with name 'unknown' is loaded into memory",
f"Known configs: {list(vban.configs.keys())}",
@@ -24,3 +24,13 @@ class TestErrors:
e = exc_info.value
assert e.message == "\n".join(EXPECTED_MSG)
def test_it_tests_an_invalid_config_key(self):
CONFIG = {
"strip-0": {"A1": True, "B1": True, "gain": -6.0},
"bus-0": {"mute": True, "eq": {"on": True}},
"unknown-0": {"state": True},
"vban-out-1": {"name": "streamname"},
}
with pytest.raises(ValueError, match="invalid config key 'unknown'"):
vban.apply(CONFIG)