mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-05-27 06:09:56 -07:00
Tests: test that worlds don't create regions or locations after create_items (#1465)
* Tests: test that worlds don't create regions or locations after `create_items` * recache during the location counts just to be extra safe * adjust typing and use a Tuple instead of a list * remove unused import
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
from argparse import Namespace
|
||||
from typing import Type, Tuple
|
||||
|
||||
from BaseClasses import MultiWorld
|
||||
from worlds.AutoWorld import call_all
|
||||
from worlds.AutoWorld import call_all, World
|
||||
|
||||
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")
|
||||
|
||||
|
||||
def setup_solo_multiworld(world_type) -> MultiWorld:
|
||||
def setup_solo_multiworld(world_type: Type[World], steps: Tuple[str, ...] = gen_steps) -> MultiWorld:
|
||||
multiworld = MultiWorld(1)
|
||||
multiworld.game[1] = world_type.game
|
||||
multiworld.player_name = {1: "Tester"}
|
||||
@@ -16,6 +17,6 @@ def setup_solo_multiworld(world_type) -> MultiWorld:
|
||||
setattr(args, name, {1: option.from_any(option.default)})
|
||||
multiworld.set_options(args)
|
||||
multiworld.set_default_common_options()
|
||||
for step in gen_steps:
|
||||
for step in steps:
|
||||
call_all(multiworld, step)
|
||||
return multiworld
|
||||
|
||||
Reference in New Issue
Block a user