Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/rest/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@ def setup(*, job_id="jj1", assets: dict, media_type: str = "image/tiff; applicat
return setup



@pytest.fixture
def job_with_1_asset(job_with_results_mocker) -> BatchJob:
return job_with_results_mocker(job_id="jj1", assets={"1.tiff": "/dl/jjr1.tiff"})
Expand All @@ -734,8 +733,13 @@ def handle_content(request, context):
assert search
from_bytes = int(search.group(1))
to_bytes = int(search.group(2))
assert from_bytes < to_bytes
return TIFF_CONTENT[from_bytes : to_bytes + 1]
assert from_bytes <= to_bytes
sliced_content = TIFF_CONTENT[from_bytes : to_bytes + 1]
context.status_code = 206
context.headers["Accept-Ranges"] = "bytes"
context.headers["Content-Range"] = f"bytes {from_bytes}-{to_bytes}/{len(TIFF_CONTENT)}"
context.headers["Content-Length"] = str(len(sliced_content))
return sliced_content

requests_mock.get(
API_URL + "/jobs/jj1/results",
Expand Down
Loading