Fix broken tests
This commit is contained in:
parent
27fd73c96b
commit
5b4dc601bc
|
@ -97,12 +97,13 @@ class TestEntities(unittest.TestCase):
|
|||
self.assertFalse(item.held)
|
||||
item.hold(self.player)
|
||||
self.assertTrue(item.held)
|
||||
item.drop(2, 6)
|
||||
self.assertEqual(item.y, 2)
|
||||
item.drop()
|
||||
self.assertEqual(item.y, 1)
|
||||
self.assertEqual(item.x, 6)
|
||||
|
||||
# Pick up item
|
||||
self.player.move_down()
|
||||
self.player.move_left()
|
||||
self.player.move_right()
|
||||
self.assertTrue(item.held)
|
||||
self.assertEqual(item.held_by, self.player)
|
||||
self.assertIn(item, self.player.inventory)
|
||||
|
@ -125,9 +126,13 @@ class TestEntities(unittest.TestCase):
|
|||
item.act(self.map)
|
||||
self.assertFalse(hedgehog.dead)
|
||||
self.assertFalse(teddy_bear.dead)
|
||||
item.drop(42, 42)
|
||||
self.player.move(42, 42)
|
||||
item.hold(self.player)
|
||||
item.use()
|
||||
self.assertEqual(item.y, 42)
|
||||
self.assertEqual(item.x, 42)
|
||||
# Wait for the explosion
|
||||
for ignored in range(5):
|
||||
item.act(self.map)
|
||||
self.assertTrue(hedgehog.dead)
|
||||
self.assertTrue(teddy_bear.dead)
|
||||
|
|
|
@ -261,11 +261,7 @@ class TestGame(unittest.TestCase):
|
|||
self.assertEqual(self.game.settings.KEY_LEFT_PRIMARY, 'a')
|
||||
|
||||
# Navigate to "texture pack"
|
||||
self.game.handle_key_pressed(KeyValues.DOWN)
|
||||
self.game.handle_key_pressed(KeyValues.DOWN)
|
||||
self.game.handle_key_pressed(KeyValues.DOWN)
|
||||
self.game.handle_key_pressed(KeyValues.DOWN)
|
||||
self.game.handle_key_pressed(KeyValues.DOWN)
|
||||
for ignored in range(9):
|
||||
self.game.handle_key_pressed(KeyValues.DOWN)
|
||||
|
||||
# Change texture pack
|
||||
|
|
Loading…
Reference in New Issue