Set up pytest and coverage tooling

This commit is contained in:
2026-08-28 01:15:28 +02:00
parent 34df950cbd
commit 6afc8585db
3 changed files with 32 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from pathlib import Path
import pytest
from omicron.ssg.site import Site
@pytest.mark.parametrize(
"value, expected_origin, expected_path",
[
(None, "", Path("/")),
("http://example.com/blog", "http://example.com", Path("/blog")),
("http://example.com", "http://example.com", Path("/")),
("//example.com/blog", "//example.com", Path("/blog")),
("/blog", "", Path("/blog")),
],
)
def test_parse_base_url(value, expected_origin, expected_path):
origin, path = Site.parse_base_url(value)
assert origin == expected_origin
assert path == expected_path