mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
Tests: Make overlapping test actually print out the overlaps (#4431)
This commit is contained in:
@@ -47,13 +47,39 @@ class TestIDs(unittest.TestCase):
|
||||
"""Test that a game doesn't have item id overlap within its own datapackage"""
|
||||
for gamename, world_type in AutoWorldRegister.world_types.items():
|
||||
with self.subTest(game=gamename):
|
||||
self.assertEqual(len(world_type.item_id_to_name), len(world_type.item_name_to_id))
|
||||
len_item_id_to_name = len(world_type.item_id_to_name)
|
||||
len_item_name_to_id = len(world_type.item_name_to_id)
|
||||
|
||||
if len_item_id_to_name != len_item_name_to_id:
|
||||
self.assertCountEqual(
|
||||
world_type.item_id_to_name.values(),
|
||||
world_type.item_name_to_id.keys(),
|
||||
"\nThese items have overlapping ids with other items in its own world")
|
||||
self.assertCountEqual(
|
||||
world_type.item_id_to_name.keys(),
|
||||
world_type.item_name_to_id.values(),
|
||||
"\nThese items have overlapping names with other items in its own world")
|
||||
|
||||
self.assertEqual(len_item_id_to_name, len_item_name_to_id)
|
||||
|
||||
def test_duplicate_location_ids(self):
|
||||
"""Test that a game doesn't have location id overlap within its own datapackage"""
|
||||
for gamename, world_type in AutoWorldRegister.world_types.items():
|
||||
with self.subTest(game=gamename):
|
||||
self.assertEqual(len(world_type.location_id_to_name), len(world_type.location_name_to_id))
|
||||
len_location_id_to_name = len(world_type.location_id_to_name)
|
||||
len_location_name_to_id = len(world_type.location_name_to_id)
|
||||
|
||||
if len_location_id_to_name != len_location_name_to_id:
|
||||
self.assertCountEqual(
|
||||
world_type.location_id_to_name.values(),
|
||||
world_type.location_name_to_id.keys(),
|
||||
"\nThese locations have overlapping ids with other locations in its own world")
|
||||
self.assertCountEqual(
|
||||
world_type.location_id_to_name.keys(),
|
||||
world_type.location_name_to_id.values(),
|
||||
"\nThese locations have overlapping names with other locations in its own world")
|
||||
|
||||
self.assertEqual(len_location_id_to_name, len_location_name_to_id)
|
||||
|
||||
def test_postgen_datapackage(self):
|
||||
"""Generates a solo multiworld and checks that the datapackage is still valid"""
|
||||
|
Reference in New Issue
Block a user