feat: Test_turn

parent 03a91eb2
from unittest import TestCase
from model.data import Game, Player
class TestGame(TestCase):
def setUp(self) -> None:
super().setUp()
self.player1 = Player(name="")
self.player2 = Player()
self.game = Game([self.player1, self.player2])
def test_global_hand(self) -> None:
card1 = self.game.deck.random_card()
self.player1.give(card1)
card2 = self.game.deck.random_card()
card3 = self.game.deck.random_card()
self.player2.give(card2)
self.player2.give(card3)
self.assertTrue(card1 in self.game.global_hand, "Global hand should contain player1's card")
self.assertTrue(card2 in self.game.global_hand, "Global hand should contain player2's first card")
self.assertTrue(card3 in self.game.global_hand, "Global hand should contain player2's second card")
def test_turn(self):
self.game.new_turn()
self.assertEqual(1, len(self.game.defeats.values()), "There should have been one defeat.")
self.assertTrue(1 in self.game.defeats.values(), "A player should have one defeat.")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment