refactor: klarere typ-extraktion, fullmatch, root-prefix-test

This commit is contained in:
2026-05-04 22:09:41 +02:00
parent 8d15f02187
commit 0224581587
2 changed files with 12 additions and 5 deletions

View File

@@ -44,3 +44,7 @@ def test_parse_path_no_fach_returns_none():
def test_parse_path_with_leading_slash_normalizes():
md = parse_path("/Documents/THB/Studium/2.Semester/Databases/x.pdf", ROOT)
assert md == PathMetadata(semester="2.Semester", fach="Databases", typ=None)
def test_parse_path_root_prefix_collision_returns_none():
assert parse_path("Documents/THB/StudiumExam/2.Semester/Foo/x.pdf", ROOT) is None