예제 #1
0
 def test_draw_cards(self):
     mock_game = Mock()
     deck = Deck(mock_game)
     card1 = Card('Sample Card', Suit.FOX)
     card2 = Card('Sample Card 2', Suit.FOX)
     deck.cards = [card1, card2]
     self.assertEqual(deck.draw_cards(2), [card2, card1])
예제 #2
0
 def test_draw_card_empty_deck(self):
     mock_game = Mock()
     deck = Deck(mock_game)
     card = Card('Sample Card', Suit.FOX)
     deck.cards = []
     deck.discard_pile = [card]
     self.assertEqual(deck.draw_card(), card)
예제 #3
0
 def test_draw_cards_partially_empty_deck_empty_discard_pile(self):
     mock_game = Mock()
     deck = Deck(mock_game)
     card1 = Card('Sample Card', Suit.FOX)
     card2 = Card('Sample Card 2', Suit.FOX)
     deck.cards = [card1, card2]
     deck.discard_pile = []
     self.assertEqual(deck.draw_cards(3), [card2, card1])
예제 #4
0
 def test_draw_cards_empty_deck(self, mock_random):
     mock_game = Mock()
     deck = Deck(mock_game)
     card1 = Card('Sample Card', Suit.FOX)
     card2 = Card('Sample Card 2', Suit.FOX)
     deck.cards = []
     deck.discard_pile = [card1, card2]
     self.assertEqual(deck.draw_cards(2), [card2, card1])
예제 #5
0
 def test_reshuffle_discard_pile_into_deck(self):
     mock_game = Mock()
     deck = Deck(mock_game)
     card = Card('Sample Card', Suit.FOX)
     deck.cards = []
     deck.discard_pile = [card]
     deck.reshuffle_discard_pile_into_deck()
     self.assertEqual(deck.cards, [card])
     self.assertEqual(deck.discard_pile, [])
예제 #6
0
 def test_draw_cards_empty_deck_and_discard_pile(self):
     mock_game = Mock()
     deck = Deck(mock_game)
     deck.cards = []
     deck.discard_pile = []
     self.assertEqual(deck.draw_cards(2), [])
예제 #7
0
 def test_draw_card_empty_deck_and_discard_pile(self):
     mock_game = Mock()
     deck = Deck(mock_game)
     deck.cards = []
     deck.discard_pile = []
     self.assertIsNone(deck.draw_card())