Skip to content

Commit

Permalink
rewrite rewrite rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
NewSoupVi committed Jan 1, 2025
1 parent 4abf795 commit eb51350
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions test/general/test_entrances.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_entrance_connection_steps(self):
"""Tests that Regions and Locations aren't created after `create_items`."""
def get_entrance_name_to_source_and_target_dict(world: World):
return [
(entrance.name, entrance.parent_region.name, entrance.target.name)
(entrance.name, entrance.parent_region.name, entrance.target.connected_region)
for entrance in world.get_entrances()
]

Expand All @@ -20,17 +20,24 @@ def get_entrance_name_to_source_and_target_dict(world: World):
multiworld = setup_solo_multiworld(world_type, gen_steps)

entrances = multiworld.get_entrances()
self.assertTrue(
all(entrance.parent_region is not None and entrance.target is not None for entrance in entrances),
f"{game_name} had unconnected entrances after connect_entrances."
)

original_entrances = get_entrance_name_to_source_and_target_dict(multiworld.worlds[1])

self.assertTrue(
all(entrance[1] is not None and entrance[2] is not None for entrance in original_entrances),
f"{game_name} had unconnected entrances after {step}"
)

for step in additional_steps:
with self.subTest("Step", step=step):
call_all(multiworld, "steps")
entrances_after_step = get_entrance_name_to_source_and_target_dict(multiworld.worlds[1])
step_entrances = get_entrance_name_to_source_and_target_dict(multiworld.worlds[1])

self.assertTrue(
all(entrance[1] is not None and entrance[2] is not None for entrance in step_entrances),
f"{game_name} had unconnected entrances after {step}"
)

self.assertEqual(
original_entrances, entrances_after_step, f"{game_name} modified entrances during {step}"
original_entrances, step_entrances, f"{game_name} modified entrances during {step}"
)

0 comments on commit eb51350

Please sign in to comment.