Test credits menu

This commit is contained in:
Yohann D'ANELLO 2020-12-18 23:39:56 +01:00
parent 4b174f26e4
commit ed6457e94d
2 changed files with 14 additions and 0 deletions

View File

@ -585,3 +585,14 @@ class TestGame(unittest.TestCase):
# Exit the menu # Exit the menu
self.game.handle_key_pressed(KeyValues.SPACE) self.game.handle_key_pressed(KeyValues.SPACE)
self.assertEqual(self.game.state, GameMode.PLAY) self.assertEqual(self.game.state, GameMode.PLAY)
def test_credits(self) -> None:
"""
Load credits menu.
"""
self.game.state = GameMode.MAINMENU
self.game.display_actions(DisplayActions.MOUSE, 41, 41)
self.assertEqual(self.game.state, GameMode.CREDITS)
self.game.display_actions(DisplayActions.MOUSE, 21, 21)
self.game.display_actions(DisplayActions.REFRESH)

View File

@ -24,3 +24,6 @@ class FakePad:
def getmaxyx(self) -> Tuple[int, int]: def getmaxyx(self) -> Tuple[int, int]:
return 42, 42 return 42, 42
def inch(self, y, x) -> str:
return "i"