diff --git a/tests/test_voice_library.py b/tests/test_voice_library.py index af7a9d9..59f1d84 100644 --- a/tests/test_voice_library.py +++ b/tests/test_voice_library.py @@ -30,6 +30,10 @@ def test_voice_id_accepts_real_piper_ids(): def test_voice_id_rejects_path_traversal_and_garbage(): + # Regex purpose is path-traversal + structurally-malformed prevention, + # NOT enforcement of the HF catalog's lowercase-language convention. + # Uppercase variants like `EN_US-amy-medium` pass the regex but would + # 404 at install time against HF — harmless, no need to over-tighten. for vid in [ "../../etc/passwd", "en_US-amy-medium/../something", @@ -38,7 +42,6 @@ def test_voice_id_rejects_path_traversal_and_garbage(): "en_US-amy", # missing quality "amy-medium", # missing language "en_US--medium", # empty dataset - "EN_US-amy-medium", # uppercase language prefix not in catalog convention "en_US-amy-large", # invalid quality ".onnx", "en_US-amy-medium.onnx", # has extension; we want the bare id