Stardew Valley: Move and Rework Monstersanity Tests (#4911)

This commit is contained in:
Jérémie Bolduc
2025-05-22 10:24:04 -04:00
committed by GitHub
parent 402a8fb967
commit 984df75f83
2 changed files with 132 additions and 159 deletions

View File

@@ -120,165 +120,6 @@ class TestNoGingerIslandItemGeneration(SVTestBase):
self.assertTrue(count == 0 or count == 2)
class TestMonstersanityNone(SVTestBase):
options = {
options.Monstersanity.internal_name: options.Monstersanity.option_none,
# Not really necessary, but it adds more locations, so we don't have to remove useful items.
options.Fishsanity.internal_name: options.Fishsanity.option_all
}
@property
def run_default_tests(self) -> bool:
# None is default
return False
def test_when_generate_world_then_5_generic_weapons_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Weapon"), 5)
def test_when_generate_world_then_zero_specific_weapons_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Sword"), 0)
self.assertEqual(item_pool.count("Progressive Club"), 0)
self.assertEqual(item_pool.count("Progressive Dagger"), 0)
def test_when_generate_world_then_2_slingshots_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Slingshot"), 2)
def test_when_generate_world_then_3_shoes_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Footwear"), 3)
class TestMonstersanityGoals(SVTestBase):
options = {options.Monstersanity.internal_name: options.Monstersanity.option_goals}
def test_when_generate_world_then_no_generic_weapons_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Weapon"), 0)
def test_when_generate_world_then_5_specific_weapons_of_each_type_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Sword"), 5)
self.assertEqual(item_pool.count("Progressive Club"), 5)
self.assertEqual(item_pool.count("Progressive Dagger"), 5)
def test_when_generate_world_then_2_slingshots_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Slingshot"), 2)
def test_when_generate_world_then_4_shoes_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Footwear"), 4)
def test_when_generate_world_then_all_monster_checks_are_inaccessible(self):
for location in self.get_real_locations():
if LocationTags.MONSTERSANITY not in location_table[location.name].tags:
continue
with self.subTest(location.name):
self.assertFalse(location.can_reach(self.multiworld.state))
class TestMonstersanityOnePerCategory(SVTestBase):
options = {options.Monstersanity.internal_name: options.Monstersanity.option_one_per_category}
def test_when_generate_world_then_no_generic_weapons_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Weapon"), 0)
def test_when_generate_world_then_5_specific_weapons_of_each_type_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Sword"), 5)
self.assertEqual(item_pool.count("Progressive Club"), 5)
self.assertEqual(item_pool.count("Progressive Dagger"), 5)
def test_when_generate_world_then_2_slingshots_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Slingshot"), 2)
def test_when_generate_world_then_4_shoes_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Footwear"), 4)
def test_when_generate_world_then_all_monster_checks_are_inaccessible(self):
for location in self.get_real_locations():
if LocationTags.MONSTERSANITY not in location_table[location.name].tags:
continue
with self.subTest(location.name):
self.assertFalse(location.can_reach(self.multiworld.state))
class TestMonstersanityProgressive(SVTestBase):
options = {options.Monstersanity.internal_name: options.Monstersanity.option_progressive_goals}
def test_when_generate_world_then_no_generic_weapons_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Weapon"), 0)
def test_when_generate_world_then_5_specific_weapons_of_each_type_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Sword"), 5)
self.assertEqual(item_pool.count("Progressive Club"), 5)
self.assertEqual(item_pool.count("Progressive Dagger"), 5)
def test_when_generate_world_then_2_slingshots_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Slingshot"), 2)
def test_when_generate_world_then_4_shoes_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Footwear"), 4)
def test_when_generate_world_then_many_rings_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertIn("Hot Java Ring", item_pool)
self.assertIn("Wedding Ring", item_pool)
self.assertIn("Slime Charmer Ring", item_pool)
def test_when_generate_world_then_all_monster_checks_are_inaccessible(self):
for location in self.get_real_locations():
if LocationTags.MONSTERSANITY not in location_table[location.name].tags:
continue
with self.subTest(location.name):
self.assertFalse(location.can_reach(self.multiworld.state))
class TestMonstersanitySplit(SVTestBase):
options = {options.Monstersanity.internal_name: options.Monstersanity.option_split_goals}
def test_when_generate_world_then_no_generic_weapons_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Weapon"), 0)
def test_when_generate_world_then_5_specific_weapons_of_each_type_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Sword"), 5)
self.assertEqual(item_pool.count("Progressive Club"), 5)
self.assertEqual(item_pool.count("Progressive Dagger"), 5)
def test_when_generate_world_then_2_slingshots_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Slingshot"), 2)
def test_when_generate_world_then_4_shoes_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertEqual(item_pool.count("Progressive Footwear"), 4)
def test_when_generate_world_then_many_rings_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
self.assertIn("Hot Java Ring", item_pool)
self.assertIn("Wedding Ring", item_pool)
self.assertIn("Slime Charmer Ring", item_pool)
def test_when_generate_world_then_all_monster_checks_are_inaccessible(self):
for location in self.get_real_locations():
if LocationTags.MONSTERSANITY not in location_table[location.name].tags:
continue
with self.subTest(location.name):
self.assertFalse(location.can_reach(self.multiworld.state))
class TestProgressiveElevator(SVTestBase):
options = {
options.ElevatorProgression.internal_name: options.ElevatorProgression.option_progressive,