forked from mirror/Archipelago
Some checks failed
Analyze modified files / flake8 (push) Failing after 2m28s
Build / build-win (push) Has been cancelled
Build / build-ubuntu2204 (push) Has been cancelled
ctest / Test C++ ubuntu-latest (push) Has been cancelled
ctest / Test C++ windows-latest (push) Has been cancelled
Analyze modified files / mypy (push) Has been cancelled
Build and Publish Docker Images / Push Docker image to Docker Hub (push) Successful in 5m4s
Native Code Static Analysis / scan-build (push) Failing after 5m2s
type check / pyright (push) Successful in 1m7s
unittests / Test Python 3.11.2 ubuntu-latest (push) Failing after 16m23s
unittests / Test Python 3.12 ubuntu-latest (push) Failing after 28m19s
unittests / Test Python 3.13 ubuntu-latest (push) Failing after 14m49s
unittests / Test hosting with 3.13 on ubuntu-latest (push) Successful in 5m0s
unittests / Test Python 3.13 macos-latest (push) Has been cancelled
unittests / Test Python 3.11 windows-latest (push) Has been cancelled
unittests / Test Python 3.13 windows-latest (push) Has been cancelled
68 lines
2.9 KiB
Python
68 lines
2.9 KiB
Python
from . import GSTestBase
|
|
from ..gen.LocationData import LocationRestriction
|
|
from ..gen.LocationNames import LocationName
|
|
from ..gen.ItemNames import ItemName
|
|
|
|
|
|
class TestItemRestrictions(GSTestBase):
|
|
options = {
|
|
"item_shuffle": 3
|
|
}
|
|
|
|
def test_ensure_empty_restricts(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Airs_Rock_Reveal)
|
|
empty_item = world.create_item(ItemName.Empty)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, empty_item, False))
|
|
|
|
def test_ensure_summon_restricts(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Kibombo_Frost_Jewel)
|
|
summon = world.create_item(ItemName.Iris)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, summon, False))
|
|
|
|
def test_ensure_summon_restricts_char(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Kibombo_Frost_Jewel)
|
|
char = world.create_item(ItemName.Isaac)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, char, False))
|
|
|
|
def test_ensure_mimic_restricts(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Contigo_Isaac)
|
|
mimic = world.create_item(ItemName.Milquetoast_Mimic)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, mimic, False))
|
|
|
|
def test_ensure_event_type_restricts(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Daila_Psy_Crystal)
|
|
mimic = world.create_item(ItemName.Journeyman_Mimic)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, mimic, False))
|
|
|
|
def test_ensure_specific_restriction_low(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Idejima_Growth)
|
|
mimic = world.create_item(ItemName.Journeyman_Mimic)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, mimic, False))
|
|
coin = world.create_item(ItemName.Coins_82)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, coin, False))
|
|
|
|
def test_ensure_specific_restriction_high(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Kibombo_Douse_Drop)
|
|
mimic = world.create_item(ItemName.Journeyman_Mimic)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, mimic, False))
|
|
coin = world.create_item(ItemName.Coins_82)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, coin, False))
|
|
|
|
def test_restrict_money_by_addr(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Gaia_Rock_Sand)
|
|
coin = world.create_item(ItemName.Coins_82)
|
|
self.assertFalse(loc.can_fill(self.multiworld.state, coin, False))
|
|
|
|
def test_ensure_not_everything_restricted(self):
|
|
world = self.get_world()
|
|
loc = world.get_location(LocationName.Airs_Rock_Sleep_Bomb)
|
|
self.assertTrue(loc.location_data.restrictions == LocationRestriction.NONE)
|