Files
agentic-mobile-control/tests/test_agents_no_coupling.py
2026-07-06 23:23:44 +08:00

37 lines
1.3 KiB
Python

"""Verify that the agents/ package does not introduce accidental coupling
into the existing runtime/ modules (task 7.2)."""
from __future__ import annotations
import importlib
def test_runtime_planner_unchanged() -> None:
"""Planner should not import from agents/."""
module = importlib.import_module("runtime.planner")
source = open(module.__file__).read() # type: ignore[arg-type]
assert "agents" not in source
def test_runtime_executor_unchanged() -> None:
"""Executor should not import from agents/."""
module = importlib.import_module("runtime.executor")
source = open(module.__file__).read() # type: ignore[arg-type]
assert "agents" not in source
def test_runtime_task_unchanged() -> None:
"""TaskRunner should not import from agents/."""
module = importlib.import_module("runtime.task")
source = open(module.__file__).read() # type: ignore[arg-type]
assert "agents" not in source
def test_agents_imports_runtime() -> None:
"""agents/ should import from runtime/, not the other way around."""
collab = importlib.import_module("agents.collab_runner")
source = open(collab.__file__).read() # type: ignore[arg-type]
assert "runtime.task" in source
assert "runtime.planner" in source
assert "runtime.executor" in source