Exemple #1
0
 def test_is_not_alive_below_zero(self):
     weapon = Unarmed(base_value=0,
                      dice_quantity=0,
                      dice_max=0,
                      weight=0,
                      value=0)
     creature = Creature(first_name="John",
                         second_name="Doe",
                         stats=Stats(),
                         status=Status(),
                         weapon=weapon)
     creature._stats._health = -1
     self.assertEqual(-1, creature.stats().health())
     self.assertEqual(False, creature.is_alive())
Exemple #2
0
 def setUp(self) -> None:
     """
     Creates two goblin instances for each test. They both have all stats at 0 and a sword.
     """
     sword = Sword(base_value=0,
                   dice_quantity=0,
                   dice_max=0,
                   weight=0,
                   value=0)
     kwargs = {
         "second_name": "Goblin",
         "stats": Stats(),
         "status": Status(),
         "weapon": sword
     }
     self.attacker = Goblin(first_name="Attacker", **deepcopy(kwargs))
     self.defender = Goblin(first_name="Defender", **deepcopy(kwargs))
Exemple #3
0
 def create_status(self):
     """
     :return: Status instance. 
     """
     return Status()
Exemple #4
0
 def test_contains(self):
     status = Status()
     effect = Block()
     status._effects = [effect]
     self.assertTrue(Block in status)
Exemple #5
0
 def test_is_not_blocking(self):
     status = Status()
     status._effects = []
     self.assertFalse(status.is_blocking())
Exemple #6
0
 def test_is_blocking(self):
     status = Status()
     effect = Block()
     status._effects = [effect]
     self.assertTrue(status.is_blocking())
Exemple #7
0
 def test_does_not_contain(self):
     status = Status()
     status._effects = []
     self.assertFalse(Block in status)