def test_play_game_move(self, mock_stdout, mock_input, mock_game_event): character.set_coordinates(20, 20) try: play_game() except SystemExit: pass self.assertEqual((20, 19), character.get_coordinates())
def test_play_game_print_introduction(self, mock_stdout, mock_input): try: play_game() except SystemExit: pass self.assertTrue("VALID COMMANDS: n, w, s, e, quit, restart." in mock_stdout.getvalue())
def test_play_game_game_event(self, mock_stdout, mock_input, mock_random): character.set_hp(9) character.set_coordinates(20, 20) try: play_game() except SystemExit: pass self.assertEqual(10, character.get_hp())
def test_play_game_print_map(self, mock_stdout, mock_input): try: play_game() except SystemExit: pass self.assertTrue( "| - - - - - - - - - - - - - - - - - - - - - - - - - - - " "- - - - - - - - - - - - - - - |" in mock_stdout.getvalue())
def test_play_game_restart_game(self, mock_stdout, mock_input): try: play_game() except SystemExit: pass self.assertTrue("RESTART GAME" in mock_stdout.getvalue())
def test_play_game_quit_game(self, mock_stdout, mock_input): try: play_game() except SystemExit: pass self.assertTrue("GAME SAVED" in mock_stdout.getvalue())