From a4a10e340da74ead2220a00f5bbf8be73266c8d5 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 11 Dec 2020 18:44:05 +0100 Subject: [PATCH] Test clicking on the merchant pad --- squirrelbattle/display/display_manager.py | 2 +- squirrelbattle/tests/game_test.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/squirrelbattle/display/display_manager.py b/squirrelbattle/display/display_manager.py index 203fc82..f9b3f01 100644 --- a/squirrelbattle/display/display_manager.py +++ b/squirrelbattle/display/display_manager.py @@ -99,7 +99,7 @@ class DisplayManager: self.playerinventorydisplay.refresh( self.rows // 10, self.cols // 2, 8 * self.rows // 10, 2 * self.cols // 5) - displays.append(self.inventorydisplay) + displays.append(self.playerinventorydisplay) elif self.game.state == GameMode.STORE: self.storeinventorydisplay.refresh( self.rows // 10, self.cols // 2, diff --git a/squirrelbattle/tests/game_test.py b/squirrelbattle/tests/game_test.py index e079035..bc3ce12 100644 --- a/squirrelbattle/tests/game_test.py +++ b/squirrelbattle/tests/game_test.py @@ -539,9 +539,10 @@ class TestGame(unittest.TestCase): # The second item is not a heart merchant.inventory[1] = Sword() - # Buy the second item + # Buy the second item by clicking on it item = self.game.store_menu.validate() self.assertIn(item, merchant.inventory) + self.game.display_actions(DisplayActions.MOUSE, 8, 25) self.game.handle_key_pressed(KeyValues.ENTER) self.assertIn(item, self.game.player.inventory) self.assertNotIn(item, merchant.inventory)