(scan_dir: Path, candidate: Path)
| 3495 | |
| 3496 | |
| 3497 | def available_artifact_path(scan_dir: Path, candidate: Path) -> Path | None: |
| 3498 | try: |
| 3499 | resolved_scan_dir = require_canonical_scan_directory(scan_dir) |
| 3500 | resolved = candidate.resolve(strict=True) |
| 3501 | resolved.relative_to(resolved_scan_dir) |
| 3502 | except (FileNotFoundError, RuntimeError, SystemExit, ValueError): |
| 3503 | return None |
| 3504 | if resolved != candidate or not candidate.is_file(): |
| 3505 | return None |
| 3506 | return resolved |
| 3507 | |
| 3508 | |
| 3509 | def artifact_path(scan_dir: Path, file_name: str, *, required: bool) -> Path | None: |
no test coverage detected