예제 #1
0
 def test_deal_one3(self):  #checks that the function works with valid list
     deck1 = DeckOfCards()
     deck1.listcards = []
     for i in range(50):
         card1 = Card(1, "Heart")
         deck1.listcards.append(card1)
     length = len(deck1.listcards)
     print(length)
     deck1.dealOne()
     print(len(deck1.listcards))
     self.assertTrue(len(deck1.listcards) == length - 1)
예제 #2
0
 def test_deal_one1(
         self):  #checks that function not works with over than full list
     deck1 = DeckOfCards()
     deck1.listcards = []
     for i in range(53):
         card1 = Card(i + 1, "Heart")
         deck1.listcards.append(card1)
     self.assertTrue(deck1.dealOne() != True)
예제 #3
0
 def test_deal_one(self):  #checks that function not works with empty list
     # with patch ('games.cards.DeckOfCards.DeckOfCards.dealOne') as mock_dealone:
     #     mock_dealone.return_value = 5
     #     deck1 = DeckOfCards()
     #     self.assertTrue(deck1.dealOne(),5)
     deck1 = DeckOfCards()
     deck1.listcards = []
     self.assertFalse(deck1.dealOne())
예제 #4
0
 def test_deal_one2(
     self
 ):  #checks that function not work with value that isn't type 'Card'
     deck1 = DeckOfCards()
     deck1.listcards = []
     for i in range(50):
         card1 = Card(i + 1, "Heart")
         deck1.listcards.append(card1)
     deck1.listcards.append(4)
     self.assertFalse(deck1.dealOne())