diff --git a/tests/test_agent_context_loader.py b/tests/test_agent_context_loader.py index b45f38e5..326abb95 100644 --- a/tests/test_agent_context_loader.py +++ b/tests/test_agent_context_loader.py @@ -13,7 +13,7 @@ def _set_project_root(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: def test_build_role_system_context_reads_runtime_workspaces(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: _set_project_root(monkeypatch, tmp_path) - ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "main" + ws = tmp_path / "runtime" / "workspaces" / "main" ws.mkdir(parents=True, exist_ok=True) (ws / "SOUL.md").write_text("main soul", encoding="utf-8") (ws / "ROLE_SYSTEM.md").write_text("main role system", encoding="utf-8") @@ -28,7 +28,7 @@ def test_build_role_system_context_cache_invalidates_on_file_change( monkeypatch: pytest.MonkeyPatch, tmp_path: Path ) -> None: _set_project_root(monkeypatch, tmp_path) - ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "ops" + ws = tmp_path / "runtime" / "workspaces" / "ops" ws.mkdir(parents=True, exist_ok=True) role_file = ws / "ROLE_SYSTEM.md" role_file.write_text("v1", encoding="utf-8") @@ -41,7 +41,7 @@ def test_build_role_system_context_cache_invalidates_on_file_change( def test_build_role_system_context_renders_template_vars(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: _set_project_root(monkeypatch, tmp_path) - ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "ops" + ws = tmp_path / "runtime" / "workspaces" / "ops" ws.mkdir(parents=True, exist_ok=True) (ws / "ROLE_SYSTEM.md").write_text("experts={{EXPERTS_HINT}}", encoding="utf-8") out = loader_mod.build_role_system_context("ops", template_vars={"EXPERTS_HINT": "ops,generalist"}) @@ -52,7 +52,7 @@ def test_build_role_system_context_template_var_isolated_by_cache_key( monkeypatch: pytest.MonkeyPatch, tmp_path: Path ) -> None: _set_project_root(monkeypatch, tmp_path) - ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "ops" + ws = tmp_path / "runtime" / "workspaces" / "ops" ws.mkdir(parents=True, exist_ok=True) (ws / "ROLE_SYSTEM.md").write_text("x={{A}}", encoding="utf-8") a = loader_mod.build_role_system_context("ops", template_vars={"A": "one"}) diff --git a/tests/test_oclaw_project_context_prompt.py b/tests/test_oclaw_project_context_prompt.py index 68c6c004..ce78674d 100644 --- a/tests/test_oclaw_project_context_prompt.py +++ b/tests/test_oclaw_project_context_prompt.py @@ -14,7 +14,7 @@ class _Store: def test_build_project_context_block_reads_workspace_bootstrap(monkeypatch, tmp_path: Path) -> None: - ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "main" + ws = tmp_path / "runtime" / "workspaces" / "main" ws.mkdir(parents=True, exist_ok=True) (ws / "TOOLS.md").write_text("tooling note", encoding="utf-8") monkeypatch.setattr("oclaw.runtime.project_context_prompt.PROJECT_ROOT", tmp_path) @@ -38,7 +38,7 @@ def test_build_project_context_block_fallback_to_project_root(monkeypatch, tmp_p def test_build_project_context_block_triggers_bootstrap_for_each_root(monkeypatch, tmp_path: Path) -> None: - ws_agent = tmp_path / "oclaw" / "runtime" / "workspaces" / "main" + ws_agent = tmp_path / "runtime" / "workspaces" / "main" ws_agent.mkdir(parents=True, exist_ok=True) (ws_agent / "TOOLS.md").write_text("agent root", encoding="utf-8") monkeypatch.setattr("oclaw.runtime.project_context_prompt.PROJECT_ROOT", tmp_path) @@ -62,8 +62,8 @@ def test_build_project_context_block_triggers_bootstrap_for_each_root(monkeypatc def test_project_context_bootstrap_includes_agent_id_when_config_matches(monkeypatch, tmp_path: Path) -> None: - ws_agent = tmp_path / "oclaw" / "runtime" / "workspaces" / "main" - ws_social = tmp_path / "oclaw" / "workspace-social" + ws_agent = tmp_path / "runtime" / "workspaces" / "main" + ws_social = tmp_path / "workspace-social" ws_agent.mkdir(parents=True, exist_ok=True) ws_social.mkdir(parents=True, exist_ok=True) (ws_agent / "TOOLS.md").write_text("agent root", encoding="utf-8")