Merge pull request 'feat: Restore bare-environment full-suite cache-policy test' (#1474) from timmy/1473-restore-bare-environment-full-suite-cache-policy into main
All checks were successful
CI / lint (push) Successful in 3m49s
CI / build-release (push) Successful in 7s
CI / browser-journey (push) Successful in 7m27s
CI / release-candidate (push) Successful in 7s

This commit is contained in:
timmy 2026-08-27 16:49:42 +00:00
commit 12a7a3c4b0

View File

@ -6,6 +6,8 @@ from src import main
@pytest.mark.anyio
async def test_live_gitea_api_responses_cannot_be_stored_by_shared_caches(monkeypatch):
monkeypatch.setenv("STACKCHAIN_DASHBOARD_AUTH_MODE", "insecure-local")
async def user():
return {"id": 1, "login": "timmy"}
@ -15,13 +17,17 @@ async def test_live_gitea_api_responses_cannot_be_stored_by_shared_caches(monkey
async def empty_events(user_data=None):
return []
async def empty_live_snapshot(**_revisions):
return main.JSONResponse({})
monkeypatch.setattr(main, "current_user", user)
monkeypatch.setattr(main, "repos", empty_collection)
monkeypatch.setattr(main, "issues", empty_collection)
monkeypatch.setattr(main, "pull_requests", empty_collection)
monkeypatch.setattr(main, "activity_events", empty_events)
monkeypatch.setattr(main, "_live_snapshot_response", empty_live_snapshot)
transport = httpx.ASGITransport(app=main.app)
transport = httpx.ASGITransport(app=main.app, client=("127.0.0.1", 1234))
async with httpx.AsyncClient(transport=transport, base_url="http://test") as client:
for path in ("/api/v1/context", "/api/v1/events", "/api/v1/live"):
response = await client.get(path)