From e413619c26c30322110f963e36fef044b64073b2 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Thu, 1 Sep 2022 21:25:06 +0200 Subject: [PATCH] Tests: verify that a world doesn't use the same ID multiple times (#985) --- test/general/TestIDs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/general/TestIDs.py b/test/general/TestIDs.py index f91775c8..db1c9461 100644 --- a/test/general/TestIDs.py +++ b/test/general/TestIDs.py @@ -52,3 +52,13 @@ class TestIDs(unittest.TestCase): else: for location_id in world_type.location_id_to_name: self.assertGreater(location_id, 0) + + def testDuplicateItemIDs(self): + 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)) + + def testDuplicateLocationIDs(self): + 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))