Skip to content

Commit

Permalink
Add GEN_KW duplicate key test
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 19, 2023
1 parent 0ff1294 commit 8240904
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/unit_tests/config/test_gen_kw_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@ def test_gen_kw_config():
assert len(conf.transfer_functions) == 3


@pytest.mark.usefixtures("use_tmpdir")
def test_gen_kw_config_duplicate_keys_raises():
with pytest.raises(
ConfigValidationError,
match="Duplicate GEN_KW keys 'KEY2' found, keys are required to be unique.",
):
GenKwConfig(
name="KEY",
forward_init=False,
template_file="",
transfer_function_definitions=[
"KEY1 UNIFORM 0 1",
"KEY2 UNIFORM 0 1",
"KEY2 UNIFORM 0 1",
"KEY3 UNIFORM 0 1",
],
output_file="kw.txt",
)


@pytest.mark.usefixtures("use_tmpdir")
def test_gen_kw_config_get_priors():
parameter_file = "parameters.txt"
Expand Down

0 comments on commit 8240904

Please sign in to comment.