Skip to content

Commit

Permalink
Stardew Valley: Import base multiworld setup in tests and use it (Arc…
Browse files Browse the repository at this point in the history
  • Loading branch information
alwaysintreble authored and FlySniper committed Nov 14, 2023
1 parent b474330 commit f645ea4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions worlds/stardew_valley/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from BaseClasses import MultiWorld
from test.TestBase import WorldTestBase
from test.general import gen_steps
from test.general import gen_steps, setup_solo_multiworld as setup_base_solo_multiworld
from .. import StardewValleyWorld, options
from ..mods.mod_data import ModNames
from ...AutoWorld import call_all
from worlds.AutoWorld import call_all


class SVTestBase(WorldTestBase):
Expand Down Expand Up @@ -106,17 +106,14 @@ def setup_solo_multiworld(test_options=None, seed=None,
if frozen_options in _cache:
return _cache[frozen_options]

multiworld = MultiWorld(1)
multiworld.game[1] = StardewValleyWorld.game
multiworld.player_name = {1: "Tester"}
multiworld = setup_base_solo_multiworld(StardewValleyWorld, ())
multiworld.set_seed(seed)
# print(f"Seed: {multiworld.seed}") # Uncomment to print the seed for every test
args = Namespace()
for name, option in StardewValleyWorld.option_definitions.items():
value = option(test_options[name]) if name in test_options else option.from_any(option.default)
setattr(args, name, {1: value})
multiworld.set_options(args)
multiworld.set_default_common_options()
for step in gen_steps:
call_all(multiworld, step)

Expand Down

0 comments on commit f645ea4

Please sign in to comment.