mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-16 14:05:10 +00:00
fix(api): cast download job options with the dl click types
cast_dl_params feeds ctx.params to dl() and dl.result() as on the CLI. A string lang value now returns 400 instead of splitting into letters, and -r accepts HDR10+.
This commit is contained in:
@@ -211,14 +211,6 @@ def test_no_duplicate_choices(param_type):
|
||||
assert len(lowered) == len(set(lowered))
|
||||
|
||||
|
||||
def test_api_codec_lists_come_from_the_param_types():
|
||||
from unshackle.core.api.handlers import VALID_ACODECS, VALID_SUB_FORMATS, VALID_VCODECS
|
||||
|
||||
assert VALID_ACODECS == [c.upper() for c in AUDIO_CODEC_LIST.choices]
|
||||
assert VALID_VCODECS == [c.upper() for c in VIDEO_CODEC_LIST.choices]
|
||||
assert VALID_SUB_FORMATS == [c.upper() for c in SUBTITLE_CODEC.choices]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", ["avc,,hevc", ["avc", "", "hevc"], " avc , hevc "])
|
||||
def test_empty_video_codec_tokens_are_skipped(value):
|
||||
"""A None in the list reaches track filtering and crashes it, so blanks must drop out."""
|
||||
|
||||
@@ -591,7 +591,7 @@ def test_a_rest_job_gives_the_flag_to_the_service_ctx_and_to_dl(
|
||||
import click
|
||||
|
||||
class FakeDl:
|
||||
cli = click.Command("dl")
|
||||
cli = dl_module.dl.cli
|
||||
|
||||
def __init__(self, ctx: click.Context, **kwargs: object) -> None:
|
||||
self.ctx = ctx
|
||||
|
||||
Reference in New Issue
Block a user