mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00

* Move to new options system. switch to using self.random reformat rules file. * further reformats * fix tests to use new options system. * fix slot data to not use self.multiworld * I hate python * new starting_items docstring to prepare for 1.20.5+ item components. fix invalid json being output to starting_items * more typing fixes. * stupid quotes around type declarations * removed unused variable in ItemPool.py change null check in Structures.py * update rules "self" variable to a "world: MinecraftWorld" variable * get key, and not value for required bosses.
50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
from . import MCTestBase
|
|
from ..Constants import region_info
|
|
from .. import Options
|
|
|
|
from BaseClasses import ItemClassification
|
|
|
|
class AdvancementTestBase(MCTestBase):
|
|
options = {
|
|
"advancement_goal": Options.AdvancementGoal.range_end
|
|
}
|
|
# beatability test implicit
|
|
|
|
class ShardTestBase(MCTestBase):
|
|
options = {
|
|
"egg_shards_required": Options.EggShardsRequired.range_end,
|
|
"egg_shards_available": Options.EggShardsAvailable.range_end
|
|
}
|
|
|
|
# check that itempool is not overfilled with shards
|
|
def test_itempool(self):
|
|
assert len(self.multiworld.get_unfilled_locations()) == len(self.multiworld.itempool)
|
|
|
|
class CompassTestBase(MCTestBase):
|
|
def test_compasses_in_pool(self):
|
|
structures = [x[1] for x in region_info["default_connections"]]
|
|
itempool_str = {item.name for item in self.multiworld.itempool}
|
|
for struct in structures:
|
|
assert f"Structure Compass ({struct})" in itempool_str
|
|
|
|
class NoBeeTestBase(MCTestBase):
|
|
options = {
|
|
"bee_traps": Options.BeeTraps.range_start
|
|
}
|
|
|
|
# With no bees, there are no traps in the pool
|
|
def test_bees(self):
|
|
for item in self.multiworld.itempool:
|
|
assert item.classification != ItemClassification.trap
|
|
|
|
|
|
class AllBeeTestBase(MCTestBase):
|
|
options = {
|
|
"bee_traps": Options.BeeTraps.range_end
|
|
}
|
|
|
|
# With max bees, there are no filler items, only bee traps
|
|
def test_bees(self):
|
|
for item in self.multiworld.itempool:
|
|
assert item.classification != ItemClassification.filler
|