From b8abe9f98089c54c78b329b7105dc52fbddea811 Mon Sep 17 00:00:00 2001 From: alwaysintreble Date: Sun, 15 Jan 2023 13:18:32 -0600 Subject: [PATCH] Tests: add a test to check for dupe locations (#1378) --- test/general/TestLocations.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/general/TestLocations.py diff --git a/test/general/TestLocations.py b/test/general/TestLocations.py new file mode 100644 index 00000000..f08939bc --- /dev/null +++ b/test/general/TestLocations.py @@ -0,0 +1,16 @@ +import unittest +from collections import Counter +from worlds.AutoWorld import AutoWorldRegister +from . import setup_default_world + + +class TestBase(unittest.TestCase): + def testCreateDuplicateLocations(self): + for game_name, world_type in AutoWorldRegister.world_types.items(): + if game_name in {"Final Fantasy"}: + continue + multiworld = setup_default_world(world_type) + locations = Counter(multiworld.get_locations()) + if locations: + self.assertLessEqual(locations.most_common(1)[0][1], 1, + f"{world_type.game} has duplicate of location {locations.most_common(1)}")