From 7c91458b4b6b787521514380982a19d0d64bbd63 Mon Sep 17 00:00:00 2001 From: Titus Date: Thu, 26 Nov 2026 17:15:59 +0100 Subject: [PATCH] kanka: a test that a second location is kept beside the single link A Character's location takes one place; a second in entityLocations is kept as x_kanka_locations and reported. No test reached that branch, and the three real exports hold no such entity. Watched failing on a plant that drops the second location. Co-Authored-By: Claude Opus 5.5 --- tests/test_kanka.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_kanka.py b/tests/test_kanka.py index d8adc68..446164f 100644 --- a/tests/test_kanka.py +++ b/tests/test_kanka.py @@ -347,6 +347,20 @@ def test_starter_entries_are_imported_and_named(tmp_path: Path) -> None: assert kingdom["x_kanka_population"] == "~50'000" +def test_a_second_location_is_kept_beside_the_single_link(tmp_path: Path) -> None: + """A Character's `location` takes one place; a second in entityLocations is kept, never dropped.""" + + def change(doc: dict[str, Any]) -> None: + doc["entity"]["entityLocations"].append({"location_id": 2270244}) # The quay's row id + + src = variant(tmp_path, change, "characters/allied-character-name_10074597.json") + out, report = run(tmp_path, src) + allied = by_name(out)["[Allied Character Name]"] + assert allied["location"] == eid(CAPITAL) + assert allied["x_kanka_locations"] == [eid(CAPITAL), eid(10074604)] + assert "location links one; every place kept" in report.render() + + def test_personality_not_visible_to_players_is_hidden_not_dropped(tmp_path: Path) -> None: """The starters' is_personality_visible is false: their personality traits go to a hidden Narrative.""" out, report = run(tmp_path)