feat: add resumable dataset uploads

This commit is contained in:
hailt 2026-11-12 17:31:42 +07:00
parent f8ed08b854
commit 8d40cff227
23 changed files with 913 additions and 21 deletions

View file

@ -54,6 +54,26 @@ async def test_status_and_search_filter_server_side(db):
assert one["total"] == 1 and one["items"][0]["id"] == "img1"
@pytest.mark.asyncio
async def test_locate_image_offset_matches_pages(db):
await _seed(db, 5)
async with db() as s:
loc = await svc.locate_image("p1", "img2", s)
assert loc["total"] == 5
page = await svc.list_images("p1", "all", s, limit=2, offset=loc["offset"])
assert page["items"][0]["id"] == "img2"
@pytest.mark.asyncio
async def test_locate_missing_image_is_404(db):
from fastapi import HTTPException
await _seed(db, 1)
async with db() as s:
with pytest.raises(HTTPException) as e:
await svc.locate_image("p1", "nope", s)
assert e.value.status_code == 404
@pytest.mark.asyncio
async def test_limit_is_clamped(db):
await _seed(db, 2)