Args: files: Dict mapping file paths to their contents command_outputs: Dict mapping command prefixes to their outputs Format: {"ls": {"output": "file1.py\nfile2.py", "returncode": 0}}
(self, files: dict[str, str] | None = None, command_outputs: dict[str, dict] | None = None)
| 16 | """Mock environment that simulates container file system and command execution.""" |
| 17 | |
| 18 | def __init__(self, files: dict[str, str] | None = None, command_outputs: dict[str, dict] | None = None): |
| 19 | """ |
| 20 | Args: |
| 21 | files: Dict mapping file paths to their contents |
| 22 | command_outputs: Dict mapping command prefixes to their outputs |
| 23 | Format: {"ls": {"output": "file1.py\nfile2.py", "returncode": 0}} |
| 24 | """ |
| 25 | self.files = files or {} |
| 26 | self.command_outputs = command_outputs or {} |
| 27 | self.config = MagicMock() |
| 28 | self.config.cwd = "/workspace" |
| 29 | self._executed_commands: list[str] = [] |
| 30 | |
| 31 | def execute(self, cmd: str, cwd: str | None = None, timeout: int | None = None) -> dict[str, Any]: |
| 32 | """Simulate command execution based on configured outputs.""" |
nothing calls this directly
no outgoing calls
no test coverage detected