Fix DeckEmptyError

Since deck is empty before the game is started so I add a game.start expression before drawing cards.
This commit is contained in:
雪煾 2021-03-10 14:40:39 +08:00 committed by GitHub
parent e5179384f6
commit 5da0cce4c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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