From 12c653fe1555acd052cd91be0e8dc1b09481d9a8 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 11 Nov 2020 23:13:21 +0100 Subject: [PATCH] Cover change texture pack --- dungeonbattle/tests/game_test.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dungeonbattle/tests/game_test.py b/dungeonbattle/tests/game_test.py index 2c327dc..c9bd8bb 100644 --- a/dungeonbattle/tests/game_test.py +++ b/dungeonbattle/tests/game_test.py @@ -172,6 +172,30 @@ class TestGame(unittest.TestCase): self.assertFalse(self.game.settings_menu.waiting_for_key) self.assertEqual(self.game.settings.KEY_LEFT_PRIMARY, 'a') + # Navigate to "texture pack" + self.game.handle_key_pressed(KeyValues.DOWN) + self.game.handle_key_pressed(KeyValues.DOWN) + self.game.handle_key_pressed(KeyValues.DOWN) + self.game.handle_key_pressed(KeyValues.DOWN) + self.game.handle_key_pressed(KeyValues.DOWN) + + # Change texture pack + self.assertEqual(self.game.settings.TEXTURE_PACK, "ascii") + self.game.handle_key_pressed(KeyValues.ENTER) + self.assertEqual(self.game.settings.TEXTURE_PACK, "squirrel") + self.game.handle_key_pressed(KeyValues.ENTER) + self.assertEqual(self.game.settings.TEXTURE_PACK, "ascii") + + # Navigate to "back" button + self.game.handle_key_pressed(KeyValues.DOWN) + self.game.handle_key_pressed(KeyValues.DOWN) + self.game.handle_key_pressed(KeyValues.DOWN) + self.game.handle_key_pressed(KeyValues.DOWN) + self.game.handle_key_pressed(KeyValues.DOWN) + + self.game.handle_key_pressed(KeyValues.ENTER) + self.assertEqual(self.game.state, GameMode.MAINMENU) + def test_dead_screen(self) -> None: """ Kill player and render dead screen.