Convert a host path to its corresponding virtual path relative to rootfs. Args: hostpath : host path Returns: the corresponding virtual path Raises: `ValueError` in case the host path does not map to a rootfs location
(self, hostpath: str)
| 266 | return True |
| 267 | |
| 268 | def host_to_virtual_path(self, hostpath: str) -> str: |
| 269 | """Convert a host path to its corresponding virtual path relative to rootfs. |
| 270 | |
| 271 | Args: |
| 272 | hostpath : host path |
| 273 | |
| 274 | Returns: the corresponding virtual path |
| 275 | |
| 276 | Raises: `ValueError` in case the host path does not map to a rootfs location |
| 277 | """ |
| 278 | |
| 279 | resolved = Path(hostpath).resolve(strict=False) |
| 280 | virtpath = self._cwd_anchor / resolved.relative_to(self._rootfs_path) |
| 281 | |
| 282 | return str(virtpath) |
| 283 | |
| 284 | def is_virtual_abspath(self, virtpath: str) -> bool: |
| 285 | """Determine whether a given virtual path is absolute. |
no test coverage detected