mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-17 22:45:06 +00:00
fix(cli): make the click param types the one source of codec spellings
--acodec now lists its codecs in --help, --vcodec drops the duplicate entries, and the REST API derives its allowlists from the same types, so AC-4, DDP, VORB and sub_format "original" stop being rejected and H264 stops being silently dropped. Adds shell completion for --acodec and repairs MultipleChoice completion. Raises the click floor to 8.2.
This commit is contained in:
@@ -314,3 +314,17 @@ async def test_search_unknown_service_raises_invalid_service() -> None:
|
||||
with pytest.raises(APIError) as exc:
|
||||
await search_handler({"service": "NOPE_THIS_IS_NOT_REAL_", "query": "x"}, None)
|
||||
assert exc.value.error_code == APIErrorCode.INVALID_SERVICE
|
||||
|
||||
|
||||
def test_resolve_vcodec_rejects_junk_as_invalid_input() -> None:
|
||||
"""Session routes skip validate_download_parameters, so a bad codec must be a 400, not a 500."""
|
||||
from unshackle.core.api.errors import APIErrorCode
|
||||
from unshackle.core.api.handlers import resolve_vcodec
|
||||
from unshackle.core.tracks import Video
|
||||
|
||||
assert resolve_vcodec(["H265"]) == [Video.Codec.HEVC]
|
||||
assert resolve_vcodec(None) is None
|
||||
for junk in ("XVID", 5, [5]):
|
||||
with pytest.raises(APIError) as exc:
|
||||
resolve_vcodec(junk)
|
||||
assert exc.value.error_code == APIErrorCode.INVALID_INPUT
|
||||
|
||||
Reference in New Issue
Block a user