MCPcopy Create free account
hub / github.com/Claw-AI-Lab/Claw-AI-Lab / FakeSandbox

Class FakeSandbox

backend/agent/tests/test_code_agent.py:56–71  ·  view source on GitHub ↗

Fake sandbox for testing.

Source from the content-addressed store, hash-verified

54
55
56class FakeSandbox:
57 """Fake sandbox for testing."""
58
59 def __init__(self, results: list[FakeSandboxResult] | None = None):
60 self.runs: list[Path] = []
61 self._results = list(results or [FakeSandboxResult()])
62 self._run_idx = 0
63
64 def run_project(
65 self, project_dir: Path, *, entry_point: str = "main.py",
66 timeout_sec: int = 300,
67 ) -> FakeSandboxResult:
68 self.runs.append(project_dir)
69 result = self._results[min(self._run_idx, len(self._results) - 1)]
70 self._run_idx += 1
71 return result
72
73
74@pytest.fixture()

Calls

no outgoing calls