From 65864e273b372889bbd64d254890c1cbacdc65ac Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 1 Apr 2022 03:32:17 +0200 Subject: [PATCH] Fix bugs --- test/general/TestReachability.py | 7 +++++-- worlds/hk/Options.py | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/general/TestReachability.py b/test/general/TestReachability.py index d6eb74dd..331f52bf 100644 --- a/test/general/TestReachability.py +++ b/test/general/TestReachability.py @@ -5,6 +5,7 @@ from worlds.AutoWorld import AutoWorldRegister from . import setup_default_world + class TestBase(unittest.TestCase): gen_steps = ["generate_early", "create_regions", "create_items", "set_rules", "generate_basic", "pre_fill"] @@ -14,10 +15,12 @@ class TestBase(unittest.TestCase): if game_name != "Ori and the Blind Forest" and game_name != "Final Fantasy": # TODO: fix Ori Logic with self.subTest("Game", game=game_name): world = setup_default_world(world_type) + excluded = world.exclude_locations[1].value state = world.get_all_state(False) for location in world.get_locations(): - with self.subTest("Location should be reached", location=location): - self.assertTrue(location.can_reach(state)) + if location.name not in excluded: + with self.subTest("Location should be reached", location=location): + self.assertTrue(location.can_reach(state)) def testEmptyStateCanReachSomething(self): for game_name, world_type in AutoWorldRegister.world_types.items(): diff --git a/worlds/hk/Options.py b/worlds/hk/Options.py index 0a4cd54f..afb85315 100644 --- a/worlds/hk/Options.py +++ b/worlds/hk/Options.py @@ -2,9 +2,10 @@ import typing from .ExtractedData import logic_options, starts, pool_options from Options import Option, DefaultOnToggle, Toggle, Choice, Range +locations = {"option_" + start: i for i, start in enumerate(starts)} # This way the dynamic start names are picked up by the MetaClass Choice belongs to -StartLocation = type("StartLocation", (Choice,), { - "option_" + start: i for i, start in enumerate(starts)} | {"auto_display_name": False}) +StartLocation = type("StartLocation", (Choice,), {"auto_display_name": False, **locations}) +del (locations) default_on = { "RandomizeDreamers",