Skip to content

Commit

Permalink
Actually print the different in the duplicated ids check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarno458 committed Nov 14, 2023
1 parent 0239578 commit 2a86ba0
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions test/general/test_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,27 @@ def test_duplicate_item_ids(self):
"""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))
overlap = ""
if len(world_type.item_id_to_name) != len(world_type.item_name_to_id):
overlap = \
set(world_type.item_id_to_name.values()) \
.symmetric_difference(set(world_type.item_name_to_id.keys())) or \
set(world_type.item_name_to_id.keys()) \
.symmetric_difference(set(world_type.item_id_to_name.values()))
self.assertEqual(len(world_type.item_id_to_name), len(world_type.item_name_to_id),
f"Game: {gamename}, Overlap: {overlap}")

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))
overlap = ""
if len(world_type.item_id_to_name) != len(world_type.item_name_to_id):
overlap = \
set(world_type.location_id_to_name.values()) \
.symmetric_difference(set(world_type.location_name_to_id.keys())) or \
set(world_type.location_name_to_id.keys()) \
.symmetric_difference(set(world_type.location_id_to_name.values()))

self.assertEqual(len(world_type.location_id_to_name), len(world_type.location_name_to_id),
f"Game: {gamename}, Overlap: {overlap}")

0 comments on commit 2a86ba0

Please sign in to comment.