Пример #1
0
    def test_enemy_validation_raises_typeerror_if_damage_not_int_or_float(self):
        damage = 'damage'

        with self.assertRaisesRegex(TypeError, 'Damage must be of "int" / "float" type.'):
            Enemy.validate_input_enemy(damage)
Пример #2
0
    def test_enemy_validation_raises_exception_if_damage_is_negative(self):
        damage = -5

        with self.assertRaisesRegex(ValueError, 'Damage should be positive.'):
            Enemy.validate_input_enemy(damage)