Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stardew Valley: Move test option presets to their own file #4349

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion worlds/stardew_valley/test/TestFill.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from . import SVTestBase, minimal_locations_maximal_items
from . import SVTestBase
from .assertion import WorldAssertMixin
from .options.presets import minimal_locations_maximal_items
from .. import options
from ..mods.mod_data import ModNames

Expand Down
3 changes: 2 additions & 1 deletion worlds/stardew_valley/test/TestItems.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from BaseClasses import MultiWorld, get_seed
from . import setup_solo_multiworld, SVTestCase, allsanity_no_mods_6_x_x, get_minsanity_options, solo_multiworld
from . import setup_solo_multiworld, SVTestCase, solo_multiworld
from .options.presets import allsanity_no_mods_6_x_x, get_minsanity_options
from .. import StardewValleyWorld
from ..items import Group, item_table
from ..options import Friendsanity, SeasonRandomization, Museumsanity, Shipsanity, Goal
Expand Down
4 changes: 3 additions & 1 deletion worlds/stardew_valley/test/TestLogic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from unittest import TestCase, SkipTest

from BaseClasses import MultiWorld
from . import RuleAssertMixin, setup_solo_multiworld, allsanity_mods_6_x_x, minimal_locations_maximal_items
from . import setup_solo_multiworld
from .assertion import RuleAssertMixin
from .options.presets import allsanity_mods_6_x_x, minimal_locations_maximal_items
from .. import StardewValleyWorld
from ..data.bundle_data import all_bundle_items_except_money
from ..logic.logic import StardewLogic
Expand Down
5 changes: 3 additions & 2 deletions worlds/stardew_valley/test/TestNumberLocations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from . import SVTestBase, allsanity_no_mods_6_x_x, \
allsanity_mods_6_x_x, minimal_locations_maximal_items, minimal_locations_maximal_items_with_island, get_minsanity_options, default_6_x_x
from . import SVTestBase
from .options.presets import default_6_x_x, allsanity_no_mods_6_x_x, allsanity_mods_6_x_x, get_minsanity_options, minimal_locations_maximal_items, \
minimal_locations_maximal_items_with_island
from .. import location_table
from ..items import Group, item_table

Expand Down
3 changes: 2 additions & 1 deletion worlds/stardew_valley/test/TestOptions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import itertools

from Options import NamedRange
from . import SVTestCase, allsanity_no_mods_6_x_x, allsanity_mods_6_x_x, solo_multiworld
from . import SVTestCase, solo_multiworld
from .assertion import WorldAssertMixin
from .long.option_names import all_option_choices
from .options.presets import allsanity_no_mods_6_x_x, allsanity_mods_6_x_x
from .. import items_by_group, Group, StardewValleyWorld
from ..locations import locations_by_tag, LocationTags, location_table
from ..options import ExcludeGingerIsland, ToolProgression, Goal, SeasonRandomization, TrapItems, SpecialOrderLocations, ArcadeMachineLocations, \
Expand Down
159 changes: 1 addition & 158 deletions worlds/stardew_valley/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from worlds.AutoWorld import call_all
from .assertion import RuleAssertMixin
from .options.utils import fill_namespace_with_default, parse_class_option_keys, fill_dataclass_with_default
from .. import StardewValleyWorld, options, StardewItem
from .. import StardewValleyWorld, StardewItem
from ..options import StardewValleyOption

logger = logging.getLogger(__name__)
Expand All @@ -20,163 +20,6 @@
logger.info(f"Default Test Seed: {DEFAULT_TEST_SEED}")


def default_6_x_x():
return {
options.ArcadeMachineLocations.internal_name: options.ArcadeMachineLocations.default,
options.BackpackProgression.internal_name: options.BackpackProgression.default,
options.Booksanity.internal_name: options.Booksanity.default,
options.BuildingProgression.internal_name: options.BuildingProgression.default,
options.BundlePrice.internal_name: options.BundlePrice.default,
options.BundleRandomization.internal_name: options.BundleRandomization.default,
options.Chefsanity.internal_name: options.Chefsanity.default,
options.Cooksanity.internal_name: options.Cooksanity.default,
options.Craftsanity.internal_name: options.Craftsanity.default,
options.Cropsanity.internal_name: options.Cropsanity.default,
options.ElevatorProgression.internal_name: options.ElevatorProgression.default,
options.EntranceRandomization.internal_name: options.EntranceRandomization.default,
options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.default,
options.FestivalLocations.internal_name: options.FestivalLocations.default,
options.Fishsanity.internal_name: options.Fishsanity.default,
options.Friendsanity.internal_name: options.Friendsanity.default,
options.FriendsanityHeartSize.internal_name: options.FriendsanityHeartSize.default,
options.Goal.internal_name: options.Goal.default,
options.Mods.internal_name: options.Mods.default,
options.Monstersanity.internal_name: options.Monstersanity.default,
options.Museumsanity.internal_name: options.Museumsanity.default,
options.NumberOfMovementBuffs.internal_name: options.NumberOfMovementBuffs.default,
options.EnabledFillerBuffs.internal_name: options.EnabledFillerBuffs.default,
options.QuestLocations.internal_name: options.QuestLocations.default,
options.SeasonRandomization.internal_name: options.SeasonRandomization.default,
options.Shipsanity.internal_name: options.Shipsanity.default,
options.SkillProgression.internal_name: options.SkillProgression.default,
options.SpecialOrderLocations.internal_name: options.SpecialOrderLocations.default,
options.ToolProgression.internal_name: options.ToolProgression.default,
options.TrapItems.internal_name: options.TrapItems.default,
options.Walnutsanity.internal_name: options.Walnutsanity.default
}


def allsanity_no_mods_6_x_x():
return {
options.ArcadeMachineLocations.internal_name: options.ArcadeMachineLocations.option_full_shuffling,
options.BackpackProgression.internal_name: options.BackpackProgression.option_progressive,
options.Booksanity.internal_name: options.Booksanity.option_all,
options.BuildingProgression.internal_name: options.BuildingProgression.option_progressive,
options.BundlePrice.internal_name: options.BundlePrice.option_expensive,
options.BundleRandomization.internal_name: options.BundleRandomization.option_thematic,
options.Chefsanity.internal_name: options.Chefsanity.option_all,
options.Cooksanity.internal_name: options.Cooksanity.option_all,
options.Craftsanity.internal_name: options.Craftsanity.option_all,
options.Cropsanity.internal_name: options.Cropsanity.option_enabled,
options.ElevatorProgression.internal_name: options.ElevatorProgression.option_progressive,
options.EntranceRandomization.internal_name: options.EntranceRandomization.option_disabled,
options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_false,
options.FestivalLocations.internal_name: options.FestivalLocations.option_hard,
options.Fishsanity.internal_name: options.Fishsanity.option_all,
options.Friendsanity.internal_name: options.Friendsanity.option_all_with_marriage,
options.FriendsanityHeartSize.internal_name: 1,
options.Goal.internal_name: options.Goal.option_perfection,
options.Mods.internal_name: frozenset(),
options.Monstersanity.internal_name: options.Monstersanity.option_progressive_goals,
options.Museumsanity.internal_name: options.Museumsanity.option_all,
options.EnabledFillerBuffs.internal_name: options.EnabledFillerBuffs.preset_all,
options.NumberOfMovementBuffs.internal_name: 12,
options.QuestLocations.internal_name: 56,
options.SeasonRandomization.internal_name: options.SeasonRandomization.option_randomized,
options.Shipsanity.internal_name: options.Shipsanity.option_everything,
options.SkillProgression.internal_name: options.SkillProgression.option_progressive_with_masteries,
options.SpecialOrderLocations.internal_name: options.SpecialOrderLocations.option_board_qi,
options.ToolProgression.internal_name: options.ToolProgression.option_progressive,
options.TrapItems.internal_name: options.TrapItems.option_nightmare,
options.Walnutsanity.internal_name: options.Walnutsanity.preset_all
}


def allsanity_mods_6_x_x():
allsanity = allsanity_no_mods_6_x_x()
allsanity.update({options.Mods.internal_name: frozenset(options.Mods.valid_keys)})
return allsanity


def get_minsanity_options():
return {
options.ArcadeMachineLocations.internal_name: options.ArcadeMachineLocations.option_disabled,
options.BackpackProgression.internal_name: options.BackpackProgression.option_vanilla,
options.Booksanity.internal_name: options.Booksanity.option_none,
options.BuildingProgression.internal_name: options.BuildingProgression.option_vanilla,
options.BundlePrice.internal_name: options.BundlePrice.option_very_cheap,
options.BundleRandomization.internal_name: options.BundleRandomization.option_vanilla,
options.Chefsanity.internal_name: options.Chefsanity.option_none,
options.Cooksanity.internal_name: options.Cooksanity.option_none,
options.Craftsanity.internal_name: options.Craftsanity.option_none,
options.Cropsanity.internal_name: options.Cropsanity.option_disabled,
options.ElevatorProgression.internal_name: options.ElevatorProgression.option_vanilla,
options.EntranceRandomization.internal_name: options.EntranceRandomization.option_disabled,
options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_true,
options.FestivalLocations.internal_name: options.FestivalLocations.option_disabled,
options.Fishsanity.internal_name: options.Fishsanity.option_none,
options.Friendsanity.internal_name: options.Friendsanity.option_none,
options.FriendsanityHeartSize.internal_name: 8,
options.Goal.internal_name: options.Goal.option_bottom_of_the_mines,
options.Mods.internal_name: frozenset(),
options.Monstersanity.internal_name: options.Monstersanity.option_none,
options.Museumsanity.internal_name: options.Museumsanity.option_none,
options.EnabledFillerBuffs.internal_name: options.EnabledFillerBuffs.preset_none,
options.NumberOfMovementBuffs.internal_name: 0,
options.QuestLocations.internal_name: -1,
options.SeasonRandomization.internal_name: options.SeasonRandomization.option_disabled,
options.Shipsanity.internal_name: options.Shipsanity.option_none,
options.SkillProgression.internal_name: options.SkillProgression.option_vanilla,
options.SpecialOrderLocations.internal_name: options.SpecialOrderLocations.option_vanilla,
options.ToolProgression.internal_name: options.ToolProgression.option_vanilla,
options.TrapItems.internal_name: options.TrapItems.option_no_traps,
options.Walnutsanity.internal_name: options.Walnutsanity.preset_none
}


def minimal_locations_maximal_items():
min_max_options = {
options.ArcadeMachineLocations.internal_name: options.ArcadeMachineLocations.option_disabled,
options.BackpackProgression.internal_name: options.BackpackProgression.option_vanilla,
options.Booksanity.internal_name: options.Booksanity.option_none,
options.BuildingProgression.internal_name: options.BuildingProgression.option_vanilla,
options.BundlePrice.internal_name: options.BundlePrice.option_expensive,
options.BundleRandomization.internal_name: options.BundleRandomization.option_shuffled,
options.Chefsanity.internal_name: options.Chefsanity.option_none,
options.Cooksanity.internal_name: options.Cooksanity.option_none,
options.Craftsanity.internal_name: options.Craftsanity.option_none,
options.Cropsanity.internal_name: options.Cropsanity.option_disabled,
options.ElevatorProgression.internal_name: options.ElevatorProgression.option_vanilla,
options.EntranceRandomization.internal_name: options.EntranceRandomization.option_disabled,
options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_true,
options.FestivalLocations.internal_name: options.FestivalLocations.option_disabled,
options.Fishsanity.internal_name: options.Fishsanity.option_none,
options.Friendsanity.internal_name: options.Friendsanity.option_none,
options.FriendsanityHeartSize.internal_name: 8,
options.Goal.internal_name: options.Goal.option_craft_master,
options.Mods.internal_name: frozenset(),
options.Monstersanity.internal_name: options.Monstersanity.option_none,
options.Museumsanity.internal_name: options.Museumsanity.option_none,
options.EnabledFillerBuffs.internal_name: options.EnabledFillerBuffs.preset_all,
options.NumberOfMovementBuffs.internal_name: 12,
options.QuestLocations.internal_name: -1,
options.SeasonRandomization.internal_name: options.SeasonRandomization.option_randomized,
options.Shipsanity.internal_name: options.Shipsanity.option_none,
options.SkillProgression.internal_name: options.SkillProgression.option_vanilla,
options.SpecialOrderLocations.internal_name: options.SpecialOrderLocations.option_vanilla,
options.ToolProgression.internal_name: options.ToolProgression.option_vanilla,
options.TrapItems.internal_name: options.TrapItems.option_nightmare,
options.Walnutsanity.internal_name: options.Walnutsanity.preset_none
}
return min_max_options


def minimal_locations_maximal_items_with_island():
min_max_options = minimal_locations_maximal_items()
min_max_options.update({options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_false})
return min_max_options


class SVTestCase(unittest.TestCase):
# Set False to not skip some 'extra' tests
skip_base_tests: bool = True
Expand Down
5 changes: 3 additions & 2 deletions worlds/stardew_valley/test/mods/TestMods.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import random

from BaseClasses import get_seed
from .. import SVTestBase, SVTestCase, allsanity_no_mods_6_x_x, allsanity_mods_6_x_x, solo_multiworld, \
fill_dataclass_with_default
from .. import SVTestBase, SVTestCase, solo_multiworld
from ..assertion import ModAssertMixin, WorldAssertMixin
from ..options.presets import allsanity_no_mods_6_x_x, allsanity_mods_6_x_x
from ..options.utils import fill_dataclass_with_default
from ... import items, Group, ItemClassification, create_content
from ... import options
from ...items import items_by_group
Expand Down
Loading
Loading