Exemple #1
0
 def test_upgrade_beyond_allowable(self):
     self.myPlayer.truck.addons.level = 0
     self.myPlayer.truck.money = 100000
     expectedCash = self.myPlayer.truck.money - helpers.addTogetherDictValues(stats.GameStats.costs_and_effectiveness[ObjectType.rabbitFoot]['cost'])
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.rabbitFoot)
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.rabbitFoot)
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.rabbitFoot)
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.rabbitFoot)
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.rabbitFoot)
     self.assertEqual(self.myPlayer.truck.addons.level, RabbitFootLevel.level_three)
     self.assertEqual(self.myPlayer.truck.money, expectedCash)
     self.assertTrue(isinstance(self.myPlayer.truck.addons, RabbitFoot))
Exemple #2
0
 def test_upgrade_beyond_allowable(self):
     self.myPlayer.truck.body = PoliceScanner()
     self.myPlayer.truck.body.level = 0
     self.myPlayer.truck.money = 100000
     expectedCash = self.myPlayer.truck.money - \
         helpers.addTogetherDictValues( stats.GameStats.costs_and_effectiveness[ObjectType.tank]['cost'])
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.tank)
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.tank)
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.tank)
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.tank)
     self.actionCont.upgrade_level(self.myPlayer, ObjectType.tank)
     self.assertEqual(self.myPlayer.truck.body.level, TankLevel.level_three)
     self.assertEqual(self.myPlayer.truck.money, expectedCash)
     self.assertTrue(isinstance(self.myPlayer.truck.body, Tank))