Пример #1
0
 def test_buy_card_valid(self):
     player = Player("Name", 100)
     initialBudget = player.getBudget()
     card = YuGiOhMaster.getCardByName("Blue-Eyes White Dragon")
     player.buyCard("Blue-Eyes White Dragon")
     self.assertEqual(
         player.getBudget(),
         float(initialBudget) - float(card["card_prices"]["ebay_price"]))
     self.assertEqual(len(player.getDeck()), 1)
     self.assertEqual(len(player.getTransactions()), 1)
Пример #2
0
 def test_buget(self):
     p = Player("Name", 100)
     self.assertEqual(p.getBudget(), 100)
     p.changeBudget(200)
     self.assertEqual(p.getBudget(), 200)
     self.assertIsNone(p.changeBudget("__invalid__"))