feat/raise-target-clips-limit #12
1 changed files with 23 additions and 1 deletions
|
|
@ -261,7 +261,29 @@ async def test_target_clips_validation(client, media_factory):
|
||||||
{"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")},
|
{"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")},
|
||||||
)
|
)
|
||||||
assert out_of_range.status_code == 400
|
assert out_of_range.status_code == 400
|
||||||
assert "target_clips must be between 1 and 15" in out_of_range.json()["detail"]
|
assert "target_clips must be between 1 and 31" in out_of_range.json()["detail"]
|
||||||
|
|
||||||
|
|
||||||
|
async def test_target_clips_accepts_raised_ceiling(
|
||||||
|
client, app_state, media_factory):
|
||||||
|
# The ceiling was raised from 15 to 31; the top of the new band must queue
|
||||||
|
# with the override the selector reads, and 32 must still be rejected.
|
||||||
|
resp = await _submit_file(
|
||||||
|
client,
|
||||||
|
{"acknowledged": "true", "target_clips": "31"},
|
||||||
|
{"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")},
|
||||||
|
)
|
||||||
|
job_id = _job(client, resp)
|
||||||
|
env = app_state.app.jobs[job_id]["env"]
|
||||||
|
assert env["CLIP_TARGET_MIN"] == "31" and env["CLIP_TARGET_MAX"] == "31"
|
||||||
|
|
||||||
|
too_many = await _submit_file(
|
||||||
|
client,
|
||||||
|
{"acknowledged": "true", "target_clips": "32"},
|
||||||
|
{"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")},
|
||||||
|
)
|
||||||
|
assert too_many.status_code == 400
|
||||||
|
assert "target_clips must be between 1 and 31" in too_many.json()["detail"]
|
||||||
|
|
||||||
|
|
||||||
async def test_clip_range_validation(client, media_factory):
|
async def test_clip_range_validation(client, media_factory):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue