core: fix item/location descriptions test (#2450)

This commit is contained in:
el-u
2023-11-15 07:26:10 +01:00
committed by GitHub
parent 41b6aef23c
commit 2af5410301
3 changed files with 18 additions and 21 deletions

View File

@@ -60,3 +60,12 @@ class TestBase(unittest.TestCase):
multiworld = setup_solo_multiworld(world_type)
for item in multiworld.itempool:
self.assertIn(item.name, world_type.item_name_to_id)
def test_item_descriptions_have_valid_names(self):
"""Ensure all item descriptions match an item name or item group name"""
for game_name, world_type in AutoWorldRegister.world_types.items():
valid_names = world_type.item_names.union(world_type.item_name_groups)
for name in world_type.item_descriptions:
with self.subTest("Name should be valid", game=game_name, item=name):
self.assertIn(name, valid_names,
"All item descriptions must match defined item names")