From cbe3e226b40f6aeca88c2abb788a4f04ac3c62cd Mon Sep 17 00:00:00 2001 From: eichhornchen Date: Fri, 8 Jan 2021 23:51:47 +0100 Subject: [PATCH] Repaired a merge error, tests now work. --- squirrelbattle/display/menudisplay.py | 2 +- squirrelbattle/tests/game_test.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/squirrelbattle/display/menudisplay.py b/squirrelbattle/display/menudisplay.py index 1099f5b..64d69b7 100644 --- a/squirrelbattle/display/menudisplay.py +++ b/squirrelbattle/display/menudisplay.py @@ -275,7 +275,7 @@ class ChestInventoryDisplay(MenuDisplay): def trueheight(self) -> int: return 2 + super().trueheight - def handle_click(self, y: int, x: int, game: Game) -> None: + def handle_click(self, y: int, x: int, attr: int, game: Game) -> None: """ We can select a menu item with the mouse. """ diff --git a/squirrelbattle/tests/game_test.py b/squirrelbattle/tests/game_test.py index 0901067..11dd376 100644 --- a/squirrelbattle/tests/game_test.py +++ b/squirrelbattle/tests/game_test.py @@ -897,10 +897,11 @@ class TestGame(unittest.TestCase): # The second item is not a heart chest.inventory[1] = sword = Sword() - # Take the second item by clicking on it + # Take the second item item = self.game.chest_menu.validate() self.assertIn(item, chest.inventory) - self.game.display_actions(DisplayActions.MOUSE, 7, 25) + self.game.display_actions(DisplayActions.MOUSE, 7, 25, + curses.BUTTON1_CLICKED) self.assertIn(item, self.game.player.inventory) self.assertNotIn(item, chest.inventory)