Fix bugs
This commit is contained in:
parent
199b778d2b
commit
65864e273b
|
@ -5,6 +5,7 @@ from worlds.AutoWorld import AutoWorldRegister
|
||||||
|
|
||||||
from . import setup_default_world
|
from . import setup_default_world
|
||||||
|
|
||||||
|
|
||||||
class TestBase(unittest.TestCase):
|
class TestBase(unittest.TestCase):
|
||||||
gen_steps = ["generate_early", "create_regions", "create_items", "set_rules", "generate_basic", "pre_fill"]
|
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
|
if game_name != "Ori and the Blind Forest" and game_name != "Final Fantasy": # TODO: fix Ori Logic
|
||||||
with self.subTest("Game", game=game_name):
|
with self.subTest("Game", game=game_name):
|
||||||
world = setup_default_world(world_type)
|
world = setup_default_world(world_type)
|
||||||
|
excluded = world.exclude_locations[1].value
|
||||||
state = world.get_all_state(False)
|
state = world.get_all_state(False)
|
||||||
for location in world.get_locations():
|
for location in world.get_locations():
|
||||||
with self.subTest("Location should be reached", location=location):
|
if location.name not in excluded:
|
||||||
self.assertTrue(location.can_reach(state))
|
with self.subTest("Location should be reached", location=location):
|
||||||
|
self.assertTrue(location.can_reach(state))
|
||||||
|
|
||||||
def testEmptyStateCanReachSomething(self):
|
def testEmptyStateCanReachSomething(self):
|
||||||
for game_name, world_type in AutoWorldRegister.world_types.items():
|
for game_name, world_type in AutoWorldRegister.world_types.items():
|
||||||
|
|
|
@ -2,9 +2,10 @@ import typing
|
||||||
from .ExtractedData import logic_options, starts, pool_options
|
from .ExtractedData import logic_options, starts, pool_options
|
||||||
from Options import Option, DefaultOnToggle, Toggle, Choice, Range
|
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
|
# This way the dynamic start names are picked up by the MetaClass Choice belongs to
|
||||||
StartLocation = type("StartLocation", (Choice,), {
|
StartLocation = type("StartLocation", (Choice,), {"auto_display_name": False, **locations})
|
||||||
"option_" + start: i for i, start in enumerate(starts)} | {"auto_display_name": False})
|
del (locations)
|
||||||
|
|
||||||
default_on = {
|
default_on = {
|
||||||
"RandomizeDreamers",
|
"RandomizeDreamers",
|
||||||
|
|
Loading…
Reference in New Issue