fix(spells): backfill casting times for all imported spells

This commit is contained in:
2026-09-11 15:01:42 +02:00
parent b3398c16ce
commit 24af1687ab
111 changed files with 147 additions and 12 deletions
+25
View File
@@ -212,6 +212,7 @@ class TestSpellCastTime:
cases = {
"1 round": "one_round",
"1 minute": "long",
"3 rounds": "long",
"full-round": "full_round",
"swift action": "swift",
}
@@ -227,6 +228,30 @@ class TestSpellCastTime:
with pytest.raises(ValueError, match="unknown cast time"):
self._load(tmp_path, "2 hours")
def test_imported_spells_declare_their_cast_time(self) -> None:
"""Given: the imported spell data
When: the registry is loaded
Then: exactly the KB-verified spells carry a non-standard cast_time."""
expected = {
"Enhance Water": "one_round",
"Silence": "one_round",
"Sleep": "one_round",
"Summon Instrument": "one_round",
"Summon Monster I": "one_round",
"Summon Monster II": "one_round",
"Grasp": "immediate",
"Saving Finale": "immediate",
"Make Whole": "long",
"Masterwork Transformation": "long",
"Mending": "long",
"Restoration, Lesser": "long",
}
registry = load_spell_registry(_SPELLS_DIR)
non_standard = {n for n, s in registry.items() if s.cast_time != "standard"}
assert non_standard == set(expected)
for name, code in expected.items():
assert registry[name].cast_time == code, name
class TestSpellRangeFt:
"""Given: a spell with a range category