generated from coulomb/repo-seed
Set up daily WSJF closure gates
This commit is contained in:
@@ -115,6 +115,42 @@ def test_state_hub_progress_sink_posts(monkeypatch) -> None:
|
||||
assert posts[0]["json"]["detail"]["review_required"] is False
|
||||
|
||||
|
||||
def test_state_hub_progress_includes_prior_working_memory_path(
|
||||
monkeypatch,
|
||||
tmp_path,
|
||||
) -> None:
|
||||
posts: list[dict[str, Any]] = []
|
||||
|
||||
def fake_get(url: str, **kwargs: Any) -> DummyResponse:
|
||||
return DummyResponse([])
|
||||
|
||||
def fake_post(url: str, **kwargs: Any) -> DummyResponse:
|
||||
posts.append({"url": url, **kwargs})
|
||||
return DummyResponse({"id": "progress-1"})
|
||||
|
||||
monkeypatch.setattr(httpx, "get", fake_get)
|
||||
monkeypatch.setattr(httpx, "post", fake_post)
|
||||
|
||||
result = persist_reports(_payload([
|
||||
{
|
||||
"type": "working-memory",
|
||||
"path": str(tmp_path),
|
||||
"timezone": "Europe/Berlin",
|
||||
},
|
||||
{
|
||||
"type": "state-hub-progress",
|
||||
"state_hub_url": "http://state-hub.test",
|
||||
"event_type": "daily_triage",
|
||||
},
|
||||
]))
|
||||
|
||||
assert [entry["status"] for entry in result] == ["written", "posted"]
|
||||
assert posts[0]["json"]["detail"]["working_memory_path"] == str(
|
||||
tmp_path / "daily-triage-2026-05-19-12345678.md"
|
||||
)
|
||||
assert posts[0]["json"]["detail"]["working_memory_status"] == "written"
|
||||
|
||||
|
||||
def test_state_hub_progress_sink_is_idempotent(monkeypatch) -> None:
|
||||
def fake_get(url: str, **kwargs: Any) -> DummyResponse:
|
||||
return DummyResponse([
|
||||
|
||||
Reference in New Issue
Block a user