Ejemplo n.º 1
0
    def test_make_attack_misses(self, mockRoll):
        attacker_dial = Dial(self.attacker_dial_data)
        target_dial = Dial(self.target_dial_data)
        mockRoll.return_value = 12  # will hit
        attack_roll = attacker_dial.roll_to_hit(target_dial)
        if attack_roll:
            attack_damage = attacker_dial.calculate_damage()
            target_dial.add_damage(attack_damage)

        self.assertTrue(attack_roll)
Ejemplo n.º 2
0
 def test_heal_damage(self):
     testUnit = Dial(self.attacker_dial_data)
     testUnit.add_damage(3)
     self.assertEqual(3, testUnit.damage_received)
     testUnit.heal_damage(2)
     self.assertEqual(1, testUnit.damage_received)
Ejemplo n.º 3
0
 def test_ko_flag(self):
     testUnit = Dial(self.attacker_dial_data)
     testUnit.add_damage(len(self.attacker_dial_data.get("dial")) - 1)
     self.assertTrue(testUnit.is_ko)