From ed6457e94d0f6b9c32e8bd6e10d5c9e7fb7ee5cc Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 18 Dec 2020 23:39:56 +0100 Subject: [PATCH] Test credits menu --- squirrelbattle/tests/game_test.py | 11 +++++++++++ squirrelbattle/tests/screen.py | 3 +++ 2 files changed, 14 insertions(+) diff --git a/squirrelbattle/tests/game_test.py b/squirrelbattle/tests/game_test.py index 750335f..40a2331 100644 --- a/squirrelbattle/tests/game_test.py +++ b/squirrelbattle/tests/game_test.py @@ -585,3 +585,14 @@ class TestGame(unittest.TestCase): # Exit the menu self.game.handle_key_pressed(KeyValues.SPACE) 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) diff --git a/squirrelbattle/tests/screen.py b/squirrelbattle/tests/screen.py index 9a8afe6..549fdc1 100644 --- a/squirrelbattle/tests/screen.py +++ b/squirrelbattle/tests/screen.py @@ -24,3 +24,6 @@ class FakePad: def getmaxyx(self) -> Tuple[int, int]: return 42, 42 + + def inch(self, y, x) -> str: + return "i"