Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/test_kanka.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down