From 5da0cce4c33c179fd455ea10b0d9d72d60445985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E7=85=BE?= Date: Wed, 10 Mar 2021 14:40:39 +0800 Subject: [PATCH] Fix DeckEmptyError Since deck is empty before the game is started so I add a game.start expression before drawing cards. --- test/test_player.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_player.py b/test/test_player.py index 649d115..d9b1c73 100644 --- a/test/test_player.py +++ b/test/test_player.py @@ -74,6 +74,7 @@ class Test(unittest.TestCase): def test_draw(self): p = Player(self.game, "Player 0") + self.game.start() deck_before = len(self.game.deck.cards) top_card = self.game.deck.cards[-1] @@ -85,6 +86,7 @@ class Test(unittest.TestCase): def test_draw_two(self): p = Player(self.game, "Player 0") + self.game.start() deck_before = len(self.game.deck.cards) self.game.draw_counter = 2