Tests: Add tests for location name groups (#1706)

This commit is contained in:
alwaysintreble 2023-04-14 13:11:01 -05:00 committed by GitHub
parent 469807ba01
commit f52ca2571f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -59,3 +59,13 @@ class TestBase(unittest.TestCase):
f"{game_name} modified region count during pre_fill")
self.assertGreaterEqual(location_count, len(multiworld.get_locations()),
f"{game_name} modified locations count during pre_fill")
def testLocationGroup(self):
"""Test that all location name groups contain valid locations and don't share names."""
for game_name, world_type in AutoWorldRegister.world_types.items():
with self.subTest(game_name, game_name=game_name):
for group_name, locations in world_type.location_name_groups.items():
with self.subTest(group_name, group_name=group_name):
for location in locations:
self.assertIn(location, world_type.location_name_to_id)
self.assertNotIn(group_name, world_type.location_name_to_id)