(
self,
stdout: bytes = b"",
returncode: int = 0,
stderr: bytes = b"",
wait_exc: BaseException | None = None,
)
| 82 | (`_run_bounded`) can drive: stdin/stdout/stderr streams plus wait/kill.""" |
| 83 | |
| 84 | def __init__( |
| 85 | self, |
| 86 | stdout: bytes = b"", |
| 87 | returncode: int = 0, |
| 88 | stderr: bytes = b"", |
| 89 | wait_exc: BaseException | None = None, |
| 90 | ) -> None: |
| 91 | self.stdin = MagicMock() |
| 92 | self.stdout = io.BytesIO(stdout) |
| 93 | self.stderr = io.BytesIO(stderr) |
| 94 | self.returncode = returncode |
| 95 | self.kill = MagicMock() |
| 96 | self._returncode = returncode |
| 97 | self._wait_exc = wait_exc |
| 98 | self.wait = MagicMock(side_effect=self._wait) |
| 99 | |
| 100 | def _wait(self, timeout: float | None = None) -> int: |
| 101 | if self._wait_exc is not None: |
nothing calls this directly
no outgoing calls
no test coverage detected