(self, path: str)
| 75 | return |
| 76 | |
| 77 | def get_archive(self, path: str) -> tuple[object, dict[str, object]]: |
| 78 | self.archive_calls.append(path) |
| 79 | if self.archive_error is not None: |
| 80 | raise self.archive_error |
| 81 | if path == "/workspace": |
| 82 | raise docker.errors.APIError("root archive unsupported") |
| 83 | |
| 84 | host_path = self._host_path(path) |
| 85 | buf = io.BytesIO() |
| 86 | with tarfile.open(fileobj=buf, mode="w") as tar: |
| 87 | tar.add(host_path, arcname=Path(path).name) |
| 88 | buf.seek(0) |
| 89 | return iter([buf.getvalue()]), {} |
| 90 | |
| 91 | def _host_path(self, path: str | Path) -> Path: |
| 92 | container_path = Path(path) |
no test coverage detected