Reaching 100% coverage and renamed an unused loop variable

This commit is contained in:
Nicolas Margulies 2020-11-19 20:14:47 +01:00
parent 1e5bb26f57
commit 984b12421b
2 changed files with 2 additions and 2 deletions

View File

@ -161,7 +161,7 @@ class TestEntities(unittest.TestCase):
self.assertFalse(player.move_up()) self.assertFalse(player.move_up())
self.assertTrue(player.move_left()) self.assertTrue(player.move_left())
self.assertFalse(player.move_left()) self.assertFalse(player.move_left())
for i in range(8): for _ in range(8):
self.assertTrue(player.move_down()) self.assertTrue(player.move_down())
self.assertFalse(player.move_down()) self.assertFalse(player.move_down())
self.assertTrue(player.move_right()) self.assertTrue(player.move_right())

View File

@ -17,6 +17,7 @@ class TestGame(unittest.TestCase):
""" """
self.game = Game() self.game = Game()
self.game.new_game() self.game.new_game()
self.game.logs.add_message("Hello World !")
display = DisplayManager(None, self.game) display = DisplayManager(None, self.game)
self.game.display_actions = display.handle_display_action self.game.display_actions = display.handle_display_action
@ -260,7 +261,6 @@ class TestGame(unittest.TestCase):
""" """
Tests the use of logs Tests the use of logs
""" """
self.game.logs.add_message("Hello World !")
self.assertEqual(self.game.logs.messages, ["Hello World !"]) self.assertEqual(self.game.logs.messages, ["Hello World !"])
self.game.logs.add_messages(["Hello", "World"]) self.game.logs.add_messages(["Hello", "World"])
self.assertEqual(self.game.logs.messages, ["Hello World !", self.assertEqual(self.game.logs.messages, ["Hello World !",