Repair production automation truth and schedule cleanup
This commit is contained in:
parent
8bcb416285
commit
944fd158de
19 changed files with 441 additions and 64 deletions
|
|
@ -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"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue