コード例 #1
0
ファイル: test_deck.py プロジェクト: chadfraser/RootSim
 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)
コード例 #2
0
ファイル: test_deck.py プロジェクト: chadfraser/RootSim
 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])
コード例 #3
0
ファイル: test_deck.py プロジェクト: chadfraser/RootSim
 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])
コード例 #4
0
ファイル: test_deck.py プロジェクト: chadfraser/RootSim
 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, [])
コード例 #5
0
ファイル: test_deck.py プロジェクト: chadfraser/RootSim
 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), [])
コード例 #6
0
ファイル: test_deck.py プロジェクト: chadfraser/RootSim
 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())