Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions tests/cli_commands/test_project_lifecycle_goal_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

import pytest

from loopx.cli_commands import project_lifecycle
from loopx.cli_commands import (
project_lifecycle,
project_lifecycle_refresh_state,
)
from loopx.control_plane.capability_hooks import (
POST_WRITEBACK_HOOK_RESULT_SCHEMA_VERSION,
PostWritebackHookRegistration,
Expand Down Expand Up @@ -98,7 +101,7 @@ def test_refresh_state_applies_goal_channel_delivery_postcondition(
) -> None:
captured: dict[str, Any] = {}
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"refresh_state_run",
lambda **kwargs: {
"ok": True,
Expand All @@ -108,7 +111,7 @@ def test_refresh_state_applies_goal_channel_delivery_postcondition(
},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_explore_graph_after_material_refresh",
lambda **kwargs: {
"enabled": False,
Expand All @@ -119,7 +122,7 @@ def test_refresh_state_applies_goal_channel_delivery_postcondition(
},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_human_gate_after_refresh",
lambda **kwargs: gate_sync,
)
Expand Down Expand Up @@ -147,7 +150,7 @@ def test_refresh_state_forwards_external_sink_suppression(
) -> None:
captured_kwargs: dict[str, Any] = {}
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"refresh_state_run",
lambda **kwargs: {
"ok": True,
Expand All @@ -157,7 +160,7 @@ def test_refresh_state_forwards_external_sink_suppression(
},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_explore_graph_after_material_refresh",
lambda **kwargs: {
"enabled": False,
Expand All @@ -181,7 +184,7 @@ def sync_gate(**kwargs: Any) -> dict[str, Any]:
}

monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_human_gate_after_refresh",
sync_gate,
)
Expand Down Expand Up @@ -214,7 +217,7 @@ def _record_refresh(**kwargs: Any) -> dict[str, Any]:
refresh_calls.append(kwargs)
return {"ok": True, "appended": True, "dry_run": False}

monkeypatch.setattr(project_lifecycle, "refresh_state_run", _record_refresh)
monkeypatch.setattr(project_lifecycle_refresh_state, "refresh_state_run", _record_refresh)

args = _args()
args.usage_json = (
Expand Down Expand Up @@ -262,7 +265,7 @@ def test_refresh_state_redacts_goal_channel_exception_details(
)
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"refresh_state_run",
lambda **kwargs: {
"ok": True,
Expand All @@ -272,7 +275,7 @@ def test_refresh_state_redacts_goal_channel_exception_details(
},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_explore_graph_after_material_refresh",
lambda **kwargs: {
"enabled": False,
Expand All @@ -290,7 +293,7 @@ def fail_with_private_details(**kwargs: Any) -> dict[str, Any]:
)

monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_human_gate_after_refresh",
fail_with_private_details,
)
Expand Down Expand Up @@ -355,7 +358,7 @@ def producer(value: Mapping[str, Any]) -> dict[str, object]:
producer=producer,
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"refresh_state_run",
lambda **kwargs: {
"ok": True,
Expand All @@ -372,29 +375,29 @@ def producer(value: Mapping[str, Any]) -> dict[str, object]:
},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"read_heartbeat_settlement",
lambda *args, **kwargs: SimpleNamespace(
delivery=SimpleNamespace(failure=None)
),
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"settlement_result_payload",
lambda result: {"status": "settled"},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"resolve_runtime_root",
lambda *args, **kwargs: runtime_root,
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_explore_graph_after_material_refresh",
lambda **kwargs: {"enabled": False},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_human_gate_after_refresh",
lambda **kwargs: {"enabled": False},
)
Expand Down Expand Up @@ -438,7 +441,7 @@ def projection(**kwargs: Any) -> dict[str, object]:
return {}

monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"refresh_state_run",
lambda **kwargs: {
"ok": True,
Expand All @@ -448,12 +451,12 @@ def projection(**kwargs: Any) -> dict[str, object]:
},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_explore_graph_after_material_refresh",
lambda **kwargs: {"enabled": False},
)
monkeypatch.setattr(
project_lifecycle,
project_lifecycle_refresh_state,
"sync_human_gate_after_refresh",
lambda **kwargs: {"enabled": False},
)
Expand Down
Loading