mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Tests: Check for Holes in the Item Pool (#992)
* test for holes in the item pool * Update test/general/TestItems.py Co-authored-by: alwaysintreble <mmmcheese158@gmail.com> * Update test/general/TestItems.py Co-authored-by: alwaysintreble <mmmcheese158@gmail.com> * Update test/general/TestItems.py Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> * Update test/general/TestItems.py Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> Co-authored-by: alwaysintreble <mmmcheese158@gmail.com> Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from worlds.AutoWorld import AutoWorldRegister
|
from worlds.AutoWorld import AutoWorldRegister
|
||||||
|
from . import setup_default_world
|
||||||
|
|
||||||
|
|
||||||
class TestBase(unittest.TestCase):
|
class TestBase(unittest.TestCase):
|
||||||
@@ -29,3 +30,17 @@ class TestBase(unittest.TestCase):
|
|||||||
with self.subTest(group_name, group_name=group_name):
|
with self.subTest(group_name, group_name=group_name):
|
||||||
for item in items:
|
for item in items:
|
||||||
self.assertIn(item, world_type.item_name_to_id)
|
self.assertIn(item, world_type.item_name_to_id)
|
||||||
|
|
||||||
|
def testItemCountGreaterEqualLocations(self):
|
||||||
|
for game_name, world_type in AutoWorldRegister.world_types.items():
|
||||||
|
|
||||||
|
if game_name in {"Final Fantasy"}:
|
||||||
|
continue
|
||||||
|
with self.subTest("Game", game=game_name):
|
||||||
|
world = setup_default_world(world_type)
|
||||||
|
location_count = sum(0 if location.event or location.item else 1 for location in world.get_locations())
|
||||||
|
self.assertGreaterEqual(
|
||||||
|
len(world.itempool),
|
||||||
|
location_count,
|
||||||
|
f"{game_name} Item count MUST meet or exceede the number of locations",
|
||||||
|
)
|
||||||
|
Reference in New Issue
Block a user