Files
Grinch-AP/worlds/stardew_valley/test/TestAllLogic.py
Jérémie Bolduc af7d0dbf37 Stardew Valley: implement new game (#1455)
* Stardew Valley Archipelago implementation

* fix breaking changes

* - Added and Updated Documentation for the game

* Removed fun

* Remove entire idea of step, due to possible inconsistency with the main AP core

* Commented out the desired steps, fix renaming after rebase

* Fixed wording

* tests now passes on 3.8

* run flake8

* remove dependency so apworld work again

* remove dependency for real

* - Fix Formatting in the Game Page
- Removed disabled Option Descriptions for Entrance Randomizer
- Improved Game Page's description of the Arcade Machine buffs
- Trimmed down the text on the Options page for Arcade Machines, so that it is smaller

* - Removed blankspace

* remove player field

* remove None check in options

* document the scripts

* fix pytest warning

* use importlib.resources.files

* fix

* add version requirement to importlib_resources

* remove __init__.py from data folder

* increment data version

* let the __init__.py for 3.9

* use sorted() instead of list()

* replace frozenset from fish_data with tuples

* remove dependency on pytest

* - Add a bit of text to the guide to tell them about how to redeem some received items

* - Added a comment about which mod version to use

* change single quotes for double quotes

* Minimum client version both ways

* Changed version number to be more specific. The mod will handle deciding

---------

Co-authored-by: Alex Gilbert <alexgilbert@yahoo.com>
2023-02-27 01:19:15 +01:00

54 lines
2.2 KiB
Python

import unittest
from test.general import setup_solo_multiworld
from .. import StardewValleyWorld
from ..bundle_data import all_bundle_items_except_money
from ..logic import MISSING_ITEM, _False
class TestAllLogicalItem(unittest.TestCase):
multi_world = setup_solo_multiworld(StardewValleyWorld)
world = multi_world.worlds[1]
logic = world.logic
def setUp(self) -> None:
for item in self.multi_world.get_items():
self.multi_world.state.collect(item, event=True)
def test_given_bundle_item_then_is_available_in_logic(self):
for bundle_item in all_bundle_items_except_money:
with self.subTest(bundle_item=bundle_item):
assert bundle_item.item.name in self.logic.item_rules
def test_given_item_rule_then_can_be_resolved(self):
for item in self.logic.item_rules.keys():
with self.subTest(item=item):
rule = self.logic.item_rules[item]
assert MISSING_ITEM not in repr(rule)
assert rule == _False() or rule(self.multi_world.state), f"Could not resolve rule for {item} {rule}"
def test_given_building_rule_then_can_be_resolved(self):
for item in self.logic.building_rules.keys():
with self.subTest(item=item):
rule = self.logic.building_rules[item]
assert MISSING_ITEM not in repr(rule)
assert rule == _False() or rule(self.multi_world.state), f"Could not resolve rule for {item} {rule}"
def test_given_quest_rule_then_can_be_resolved(self):
for item in self.logic.quest_rules.keys():
with self.subTest(item=item):
rule = self.logic.quest_rules[item]
assert MISSING_ITEM not in repr(rule)
assert rule == _False() or rule(self.multi_world.state), f"Could not resolve rule for {item} {rule}"
def test_given_location_rule_then_can_be_resolved(self):
for location in self.multi_world.get_locations(1):
with self.subTest(location=location):
rule = location.access_rule
assert MISSING_ITEM not in repr(rule)
assert rule == _False() or rule(self.multi_world.state), f"Could not resolve rule for {location} {rule}"