Skip to content

Commit

Permalink
clean tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvris committed Aug 26, 2023
1 parent b81d1c3 commit ec67f7f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions worlds/kdl3/test/TestGoal.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def testGoal(self):
self.assertBeatable(False)
heart_stars = self.get_items_by_name("Heart Star")
self.collect(heart_stars[0:14])
self.assertEqual(self.count("Heart Star"), 14)
self.assertEqual(self.count("Heart Star"), 14, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect(heart_stars[14:15])
self.assertEqual(self.count("Heart Star"), 15)
self.assertEqual(self.count("Heart Star"), 15, str(self.multiworld.seed))
self.assertBeatable(True)
self.remove([self.get_item_by_name("Love-Love Rod")])
self.collect_by_name("Kine") # Ensure a little more progress, but leave out cutter and burning
Expand All @@ -39,16 +39,16 @@ def testGoal(self):
self.assertBeatable(False)
heart_stars = self.get_items_by_name("Heart Star")
self.collect(heart_stars[0:14])
self.assertEqual(self.count("Heart Star"), 14)
self.assertEqual(self.count("Heart Star"), 14, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect(heart_stars[14:15])
self.assertEqual(self.count("Heart Star"), 15)
self.assertEqual(self.count("Heart Star"), 15, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect_by_name(["Burning", "Cutter", "Kine"])
self.assertBeatable(True)
self.remove([self.get_item_by_name("Love-Love Rod")])
self.collect(heart_stars)
self.assertEqual(self.count("Heart Star"), 30)
self.assertEqual(self.count("Heart Star"), 30, str(self.multiworld.seed))
self.assertBeatable(True)

def testKine(self):
Expand Down
11 changes: 5 additions & 6 deletions worlds/kdl3/test/TestLocations.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def testSimpleHeartStars(self):
def run_location_test(self, location: str, itempool: typing.List[str]):
items = itempool.copy()
while len(itempool) > 0:
assert not self.can_reach_location(location)
self.assertFalse(self.can_reach_location(location), str(self.multiworld.seed))
self.collect_by_name(itempool.pop())
assert self.can_reach_location(location)
self.assertTrue(self.can_reach_location(location), str(self.multiworld.seed))
self.remove(self.get_items_by_name(items))


Expand All @@ -59,11 +59,10 @@ class TestShiro(KDL3TestBase):
}

def testShiro(self):
assert not self.can_reach_location("Iceberg 5 - Shiro")
self.assertFalse(self.can_reach_location("Iceberg 5 - Shiro"), str(self.multiworld.seed))
self.collect_by_name("Nago")
assert not self.can_reach_location("Iceberg 5 - Shiro")
self.assertFalse(self.can_reach_location("Iceberg 5 - Shiro"), str(self.multiworld.seed))
# despite Shiro only requiring Nago for logic, it cannot be in logic because our two accessible stages
# do not actually give the player access to Nago, thus we need Kine to pass 2-5
self.collect_by_name("Kine")
assert self.can_reach_location("Iceberg 5 - Shiro")

self.assertTrue(self.can_reach_location("Iceberg 5 - Shiro"), str(self.multiworld.seed))
36 changes: 18 additions & 18 deletions worlds/kdl3/test/TestShuffles.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ def testGoal(self):
self.assertBeatable(False)
heart_stars = self.get_items_by_name("Heart Star")
self.collect(heart_stars[0:14])
self.assertEqual(self.count("Heart Star"), 14)
self.assertEqual(self.count("Heart Star"), 14, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect(heart_stars[14:15])
self.assertEqual(self.count("Heart Star"), 15)
self.assertEqual(self.count("Heart Star"), 15, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect_by_name(["Burning", "Cutter", "Kine"])
self.assertBeatable(True)
self.remove([self.get_item_by_name("Love-Love Rod")])
self.collect(heart_stars)
self.assertEqual(self.count("Heart Star"), 30)
self.assertEqual(self.count("Heart Star"), 30, str(self.multiworld.seed))
self.assertBeatable(True)

def testKine(self):
Expand Down Expand Up @@ -61,7 +61,7 @@ def testValidAbilitiesForROB(self):
required_abilities.append(tuple(potential_abilities))
collected_abilities = list()
for group in required_abilities:
self.assertFalse(len(group) == 0)
self.assertFalse(len(group) == 0, str(self.multiworld.seed))
collected_abilities.append(group[0])
self.collect_by_name([ability.replace(" Ability", "") for ability in collected_abilities])
if "Parasol Ability" not in collected_abilities or "Stone Ability" not in collected_abilities:
Expand All @@ -70,10 +70,10 @@ def testValidAbilitiesForROB(self):

if "Cutter Ability" not in collected_abilities:
# we can't actually reach 3-6 without Cutter
assert not self.can_reach_location("Sand Canyon 6 - Professor Hector & R.O.B")
self.assertFalse(self.can_reach_location("Sand Canyon 6 - Professor Hector & R.O.B"), str(self.multiworld.seed))
self.collect_by_name(["Cutter"])

assert self.can_reach_location("Sand Canyon 6 - Professor Hector & R.O.B")
self.assertTrue(self.can_reach_location("Sand Canyon 6 - Professor Hector & R.O.B"), str(self.multiworld.seed))


class TestAnimalShuffle(KDL3TestBase):
Expand All @@ -90,16 +90,16 @@ def testGoal(self):
self.assertBeatable(False)
heart_stars = self.get_items_by_name("Heart Star")
self.collect(heart_stars[0:14])
self.assertEqual(self.count("Heart Star"), 14)
self.assertEqual(self.count("Heart Star"), 14, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect(heart_stars[14:15])
self.assertEqual(self.count("Heart Star"), 15)
self.assertEqual(self.count("Heart Star"), 15, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect_by_name(["Burning", "Cutter", "Kine"])
self.assertBeatable(True)
self.remove([self.get_item_by_name("Love-Love Rod")])
self.collect(heart_stars)
self.assertEqual(self.count("Heart Star"), 30)
self.assertEqual(self.count("Heart Star"), 30, str(self.multiworld.seed))
self.assertBeatable(True)

def testKine(self):
Expand All @@ -115,9 +115,9 @@ def testBurning(self):
self.assertBeatable(False)

def testLockedAnimals(self):
self.assertTrue(self, self.multiworld.get_location("Ripple Field 5 - Animal 2", 1).item.name == "Pitch Spawn")
self.assertTrue(self, self.multiworld.get_location("Iceberg 4 - Animal 1", 1).item.name == "ChuChu Spawn")
self.assertTrue(self, self.multiworld.get_location("Sand Canyon 6 - Animal 1", 1).item.name in {"Kine Spawn", "Coo Spawn"})
self.assertTrue(self.multiworld.get_location("Ripple Field 5 - Animal 2", 1).item.name == "Pitch Spawn")
self.assertTrue(self.multiworld.get_location("Iceberg 4 - Animal 1", 1).item.name == "ChuChu Spawn")
self.assertTrue(self.multiworld.get_location("Sand Canyon 6 - Animal 1", 1).item.name in {"Kine Spawn", "Coo Spawn"})


class TestAllShuffle(KDL3TestBase):
Expand All @@ -135,16 +135,16 @@ def testGoal(self):
self.assertBeatable(False)
heart_stars = self.get_items_by_name("Heart Star")
self.collect(heart_stars[0:14])
self.assertEqual(self.count("Heart Star"), 14)
self.assertEqual(self.count("Heart Star"), 14, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect(heart_stars[14:15])
self.assertEqual(self.count("Heart Star"), 15)
self.assertEqual(self.count("Heart Star"), 15, str(self.multiworld.seed))
self.assertBeatable(False)
self.collect_by_name(["Burning", "Cutter", "Kine"])
self.assertBeatable(True)
self.remove([self.get_item_by_name("Love-Love Rod")])
self.collect(heart_stars)
self.assertEqual(self.count("Heart Star"), 30)
self.assertEqual(self.count("Heart Star"), 30, str(self.multiworld.seed))
self.assertBeatable(True)

def testKine(self):
Expand All @@ -160,6 +160,6 @@ def testBurning(self):
self.assertBeatable(False)

def testLockedAnimals(self):
self.assertTrue(self, self.multiworld.get_location("Ripple Field 5 - Animal 2", 1).item.name == "Pitch Spawn")
self.assertTrue(self, self.multiworld.get_location("Iceberg 4 - Animal 1", 1).item.name == "ChuChu Spawn")
self.assertTrue(self, self.multiworld.get_location("Sand Canyon 6 - Animal 1", 1).item.name in {"Kine Spawn", "Coo Spawn"})
self.assertTrue(self.multiworld.get_location("Ripple Field 5 - Animal 2", 1).item.name == "Pitch Spawn")
self.assertTrue(self.multiworld.get_location("Iceberg 4 - Animal 1", 1).item.name == "ChuChu Spawn")
self.assertTrue(self.multiworld.get_location("Sand Canyon 6 - Animal 1", 1).item.name in {"Kine Spawn", "Coo Spawn"})
5 changes: 3 additions & 2 deletions worlds/kdl3/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from BaseClasses import MultiWorld, PlandoOptions
from test.TestBase import WorldTestBase
from test.general import gen_steps
from ... import AutoWorld
from ...AutoWorld import call_all
from worlds import AutoWorld
from worlds.AutoWorld import call_all


class KDL3TestBase(WorldTestBase):
game = "Kirby's Dream Land 3"
Expand Down

0 comments on commit ec67f7f

Please sign in to comment.