From 606980bb7ca5f200244f6cc25ebcc1ef1bbc4df6 Mon Sep 17 00:00:00 2001 From: hailt Date: Thu, 12 Nov 2026 21:38:54 +0700 Subject: [PATCH] test: isolate storage presign tests --- tests/test_bulk.py | 6 ++++++ tests/test_pagination.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tests/test_bulk.py b/tests/test_bulk.py index eb7bb96..7f4a3e1 100644 --- a/tests/test_bulk.py +++ b/tests/test_bulk.py @@ -31,6 +31,12 @@ async def _seed(db): await s.commit() +@pytest.fixture(autouse=True) +def fake_storage(monkeypatch): + monkeypatch.setattr(img_svc.r2, "presign_put", + lambda key, content_type: f"http://storage.test/{key}") + + def _body(n=1): from shared.schemas import AnnotationShape return AnnotationUpsert(shapes=[ diff --git a/tests/test_pagination.py b/tests/test_pagination.py index 469da92..946c1ed 100644 --- a/tests/test_pagination.py +++ b/tests/test_pagination.py @@ -30,6 +30,12 @@ async def _seed(db, n=5): await s.commit() +@pytest.fixture(autouse=True) +def fake_storage(monkeypatch): + monkeypatch.setattr(svc.r2, "presign_get", + lambda key: f"http://storage.test/{key}") + + @pytest.mark.asyncio async def test_pages_cover_dataset_without_overlap(db): await _seed(db, 5)