diff --git a/tests/e2e/api/test_process_submit.py b/tests/e2e/api/test_process_submit.py index 1a91c17..e02e664 100644 --- a/tests/e2e/api/test_process_submit.py +++ b/tests/e2e/api/test_process_submit.py @@ -261,7 +261,29 @@ async def test_target_clips_validation(client, media_factory): {"file": ("clip.mp4", media_factory.six.read_bytes(), "video/mp4")}, ) 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):