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:
parent
e5179384f6
commit
5da0cce4c3
1 changed files with 2 additions and 0 deletions
|
@ -74,6 +74,7 @@ class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_draw(self):
|
def test_draw(self):
|
||||||
p = Player(self.game, "Player 0")
|
p = Player(self.game, "Player 0")
|
||||||
|
self.game.start()
|
||||||
|
|
||||||
deck_before = len(self.game.deck.cards)
|
deck_before = len(self.game.deck.cards)
|
||||||
top_card = self.game.deck.cards[-1]
|
top_card = self.game.deck.cards[-1]
|
||||||
|
@ -85,6 +86,7 @@ class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_draw_two(self):
|
def test_draw_two(self):
|
||||||
p = Player(self.game, "Player 0")
|
p = Player(self.game, "Player 0")
|
||||||
|
self.game.start()
|
||||||
|
|
||||||
deck_before = len(self.game.deck.cards)
|
deck_before = len(self.game.deck.cards)
|
||||||
self.game.draw_counter = 2
|
self.game.draw_counter = 2
|
||||||
|
|
Loading…
Reference in a new issue