Tests: test that exits to `Regions` are the parents of the `Entrance` (#1442)

This commit is contained in:
alwaysintreble 2023-02-12 19:05:52 -06:00 committed by GitHub
parent f528175d8a
commit 9e3c2e2464
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

View File

@ -7,8 +7,18 @@ from . import setup_default_world
class TestImplemented(unittest.TestCase):
def testCompletionCondition(self):
"""Ensure a completion condition is set that has requirements."""
for gamename, world_type in AutoWorldRegister.world_types.items():
if not world_type.hidden and gamename not in {"ArchipIDLE", "Final Fantasy", "Sudoku"}:
with self.subTest(gamename):
world = setup_default_world(world_type)
self.assertFalse(world.completion_condition[1](world.state))
for game_name, world_type in AutoWorldRegister.world_types.items():
if not world_type.hidden and game_name not in {"ArchipIDLE", "Final Fantasy", "Sudoku"}:
with self.subTest(game_name):
multiworld = setup_default_world(world_type)
self.assertFalse(multiworld.completion_condition[1](multiworld.state))
def testEntranceParents(self):
"""Tests that the parents of created Entrances match the exiting Region."""
for game_name, world_type in AutoWorldRegister.world_types.items():
if not world_type.hidden and game_name not in {"Final Fantasy"}:
with self.subTest(game_name):
multiworld = setup_default_world(world_type)
for region in multiworld.regions:
for exit in region.exits:
self.assertEqual(exit.parent_region, region)

View File

@ -12,7 +12,7 @@ class TestBase(unittest.TestCase):
def testAllStateCanReachEverything(self):
for game_name, world_type in AutoWorldRegister.world_types.items():
# Final Fantasy logic is controlled by finalfantasyrandomizer.com
if game_name != "Ori and the Blind Forest" and game_name != "Final Fantasy": # TODO: fix Ori Logic
if game_name not in {"Ori and the Blind Forest", "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