mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-07-29 12:10:53 -07:00
Stardew Valley: Cut tests by 3 minutes (#2375)
* Stardew Valley: Test: unify mods * Stardew Valley: Test: don't use SVTestBase where setUp is unused * Stardew Valley: Test: remove duplicate backpack test * Stardew Valley: Test: remove 2,3,4 heart tests assume the math is correct with just 2 points on the curve * Stardew Valley: Test: reduce duplicate test/gen runs * Stardew Valley: Test: Change 'long' tests to not use TestBase TestBase' setUp is not being used in the changed TestCases * Stardew Valley: Test: Use subtests and inheritance for backpacks * Stardew Valley: Test: add flag to skip some of the extensive tests by default
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import unittest
|
||||
from typing import List
|
||||
|
||||
from BaseClasses import MultiWorld, ItemClassification
|
||||
from ... import StardewItem
|
||||
from .. import SVTestBase
|
||||
|
||||
|
||||
def get_all_item_names(multiworld: MultiWorld) -> List[str]:
|
||||
@@ -13,21 +13,21 @@ def get_all_location_names(multiworld: MultiWorld) -> List[str]:
|
||||
return [location.name for location in multiworld.get_locations() if not location.event]
|
||||
|
||||
|
||||
def assert_victory_exists(tester: SVTestBase, multiworld: MultiWorld):
|
||||
def assert_victory_exists(tester: unittest.TestCase, multiworld: MultiWorld):
|
||||
tester.assertIn(StardewItem("Victory", ItemClassification.progression, None, 1), multiworld.get_items())
|
||||
|
||||
|
||||
def collect_all_then_assert_can_win(tester: SVTestBase, multiworld: MultiWorld):
|
||||
def collect_all_then_assert_can_win(tester: unittest.TestCase, multiworld: MultiWorld):
|
||||
for item in multiworld.get_items():
|
||||
multiworld.state.collect(item)
|
||||
tester.assertTrue(multiworld.find_item("Victory", 1).can_reach(multiworld.state))
|
||||
|
||||
|
||||
def assert_can_win(tester: SVTestBase, multiworld: MultiWorld):
|
||||
def assert_can_win(tester: unittest.TestCase, multiworld: MultiWorld):
|
||||
assert_victory_exists(tester, multiworld)
|
||||
collect_all_then_assert_can_win(tester, multiworld)
|
||||
|
||||
|
||||
def assert_same_number_items_locations(tester: SVTestBase, multiworld: MultiWorld):
|
||||
def assert_same_number_items_locations(tester: unittest.TestCase, multiworld: MultiWorld):
|
||||
non_event_locations = [location for location in multiworld.get_locations() if not location.event]
|
||||
tester.assertEqual(len(multiworld.itempool), len(non_event_locations))
|
||||
Reference in New Issue
Block a user