Repair production automation truth and schedule cleanup
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Container Image / build-and-push (push) Successful in 18s

This commit is contained in:
tegwick 2026-08-20 11:20:23 +02:00
parent 8bcb416285
commit 944fd158de
19 changed files with 441 additions and 64 deletions

View file

@ -201,6 +201,15 @@ async def test_status_endpoint_wraps_report(
}
monkeypatch.setattr(ops_api, "ops_status", fake_status)
session = AsyncMock()
session.__aenter__ = AsyncMock(return_value=session)
session.__aexit__ = AsyncMock(return_value=None)
count_result = MagicMock()
count_result.all.return_value = []
stuck_result = MagicMock()
stuck_result.scalar_one.return_value = 0
session.execute = AsyncMock(side_effect=[count_result, stuck_result])
ops_app.state.session_factory.return_value = session
transport = ASGITransport(app=ops_app)
async with AsyncClient(transport=transport, base_url="http://test") as client:
res = await client.get("/ops/automations/status", params={"since": "sunday"})