aboutsummaryrefslogtreecommitdiff
path: root/lib/project/tests/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/project/tests/test_config.py')
-rw-r--r--lib/project/tests/test_config.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/project/tests/test_config.py b/lib/project/tests/test_config.py
index 02b9eba..8da7a7f 100644
--- a/lib/project/tests/test_config.py
+++ b/lib/project/tests/test_config.py
@@ -131,3 +131,17 @@ def test_shaping_filter_toggles(bypass, toggle, prefix, count):
chain = filters(bypass)
assert len(chain) == count
assert all(item.startswith(prefix) for item in chain)
+
+
+def test_clearvoice_and_trim_settings_parse_and_validate():
+ settings = resolve(overrides={"denoiser": "clearvoice", "trim_silence": True,
+ "max_gap_s": 2.0, "gap_pad_s": 0.5,
+ "gap_threshold_db": -45.0})
+ assert settings.denoiser == "clearvoice" and settings.trim_silence is True
+ assert settings_for(parser().parse_args(["config", "--denoiser", "clearvoice"])).denoiser == "clearvoice"
+ with pytest.raises(ValueError, match="gap_pad_s must be smaller than max_gap_s"):
+ resolve(overrides={"trim_silence": True, "max_gap_s": 1.0, "gap_pad_s": 1.0})
+ with pytest.raises(ValueError, match="max_gap_s"):
+ resolve(overrides={"max_gap_s": 0.4})
+ with pytest.raises(ValueError, match="gap_threshold_db"):
+ resolve(overrides={"gap_threshold_db": -19.0})