Skip to content

Commit

Permalink
make necessary adjustments to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alwaysintreble committed Oct 29, 2023
1 parent 4087403 commit 1bea450
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions test/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def fulfills_accessibility() -> bool:
return self.multiworld.has_beaten_game(state, 1)

with self.subTest("Game", game=self.game, seed=self.multiworld.seed):
self.multiworld.update_itempool()
distribute_items_restrictive(self.multiworld)
call_all(self.multiworld, "post_fill")
self.assertTrue(fulfills_accessibility(), "Collected all locations, but can't beat the game.")
Expand Down
5 changes: 4 additions & 1 deletion test/general/test_items.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
from worlds.AutoWorld import AutoWorldRegister
from worlds.AutoWorld import AutoWorldRegister, call_all
from . import setup_solo_multiworld


Expand Down Expand Up @@ -47,6 +47,9 @@ def test_item_count_greater_equal_locations(self):
for game_name, world_type in AutoWorldRegister.world_types.items():
with self.subTest("Game", game=game_name):
multiworld = setup_solo_multiworld(world_type)
call_all(multiworld, "create_filler_items",
{1: len(multiworld.get_unfilled_locations(1)) - len(multiworld.itempool)})
multiworld.update_itempool()
self.assertGreaterEqual(
len(multiworld.itempool),
len(multiworld.get_unfilled_locations()),
Expand Down
13 changes: 11 additions & 2 deletions worlds/messenger/test/test_shop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict
from typing import Dict, Optional

from . import MessengerTestBase
from ..shop import SHOP_ITEMS, FIGURINES
Expand All @@ -10,6 +10,12 @@ class ShopCostTest(MessengerTestBase):
"shuffle_shards": "true",
}

def world_setup(self, seed: Optional[int] = None) -> None:
super().world_setup(seed)
self.multiworld.worlds[self.player].create_filler_items(
len(self.multiworld.get_unfilled_locations()) - len(self.multiworld.itempool))
self.multiworld.update_itempool()

def test_shop_rules(self) -> None:
for loc in SHOP_ITEMS:
loc = f"The Shop - {loc}"
Expand Down Expand Up @@ -69,7 +75,7 @@ def test_strike(self) -> None:
pass


class PlandoTest(MessengerTestBase):
class PlandoTest(ShopCostTest):
options = {
"shop_price_plan": {
"Karuta Plates": 50,
Expand Down Expand Up @@ -109,3 +115,6 @@ def test_costs(self) -> None:
self.assertLessEqual(price, self.multiworld.get_location(loc, self.player).cost)
self.assertTrue(loc in FIGURINES)
self.assertEqual(len(figures), len(FIGURINES))

def test_dboost(self) -> None:
pass

0 comments on commit 1bea450

Please sign in to comment.