Tests: ensure item name groups do not collide with item names (#1074)

This commit is contained in:
Fabian Dill 2023-01-18 15:45:48 +01:00 committed by GitHub
parent 91fdfe3e17
commit 2f37bedc92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -33,6 +33,14 @@ class TestBase(unittest.TestCase):
for item in items:
self.assertIn(item, world_type.item_name_to_id)
def testItemNameGroupConflict(self):
"""Test that all item name groups aren't also item names."""
for game_name, world_type in AutoWorldRegister.world_types.items():
with self.subTest(game_name, game_name=game_name):
for group_name in world_type.item_name_groups:
with self.subTest(group_name, group_name=group_name):
self.assertNotIn(group_name, world_type.item_name_to_id)
def testItemCountGreaterEqualLocations(self):
for game_name, world_type in AutoWorldRegister.world_types.items():

View File

@ -26,7 +26,7 @@ item_name_groups = {group: lookup_type_to_names[group] for group in ("Skill", "C
directionals = ('', 'Left_', 'Right_')
item_name_groups.update({
"Dreamer": {"Herrah", "Monomon", "Lurien"},
"Dreamers": {"Herrah", "Monomon", "Lurien"},
"Cloak": {x + 'Mothwing_Cloak' for x in directionals} | {'Shade_Cloak', 'Split_Shade_Cloak'},
"Claw": {x + 'Mantis_Claw' for x in directionals},
"CDash": {x + 'Crystal_Heart' for x in directionals},