Repaired a merge error, tests now work.

This commit is contained in:
eichhornchen 2021-01-08 23:51:47 +01:00
parent eac9057f31
commit cbe3e226b4
2 changed files with 4 additions and 3 deletions

View File

@ -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.
"""

View File

@ -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)