Coverage for tests/output/formatting/test_path.py: 100%
9 statements
« prev ^ index » next coverage.py v6.5.0, created at 2023-02-09 12:09 +0100
« prev ^ index » next coverage.py v6.5.0, created at 2023-02-09 12:09 +0100
1from __future__ import annotations
3from pathlib import Path
5from harbor_cli.output.formatting.path import path_link
8def test_path_link_absolute() -> None:
9 """Test path_link with absolute=True."""
10 p = Path("/tmp").resolve().absolute()
11 assert path_link(p, absolute=True) == f"[link=file://{str(p)}]{str(p)}[/link]"
14def test_path_link_relative() -> None:
15 """Test path_link with absolute=False."""
16 p = Path("/tmp")
17 assert (
18 path_link(p, absolute=False)
19 == f"[link=file://{str(p.resolve().absolute())}]/tmp[/link]"
20 )