several updates to functionality

This commit is contained in:
2026-02-02 13:16:18 +01:00
parent 1f3ba037d6
commit 3ac987ac34
19 changed files with 1808 additions and 135 deletions

27
tests/test_uid_mapping.py Normal file
View File

@@ -0,0 +1,27 @@
import unittest
from validation import validate_uid_mapping
class UidMappingTest(unittest.TestCase):
def test_ambiguous_mapping_requires_ids(self) -> None:
events = [
{"title": "Event A"},
{"title": "Event B"},
]
with self.assertRaises(ValueError) as ctx:
validate_uid_mapping(events, {"Event A"}, {2})
message = str(ctx.exception)
self.assertIn("Ambivalent UID-mapping", message)
self.assertIn("events[].id", message)
def test_ambiguous_mapping_with_ids_returns_false(self) -> None:
events = [
{"id": "log_01", "title": "Event A"},
{"id": "log_02", "title": "Event B"},
]
allow = validate_uid_mapping(events, {"Event A"}, {2})
self.assertFalse(allow)