Пример #1
0
    def test_healing_effect(self):
        """
        Test that a healing effect can be applied on a character
        """
        character = (CharacterBuilder()
                        .with_hit_points(1)
                        .with_max_hp(15)
                        .build())

        effect = Heal(duration = 0,
                      frequency = 0,
                      tick = 0,
                      healing = 10,
                      target = character)
        effect.trigger()

        assert_that(character.hit_points, is_(equal_to(11)))
Пример #2
0
    def test_healing_does_not_heal_over_max_hp(self):
        """
        Test that character does not get healed over his maximum hp when getting healing effect
        """
        character = (CharacterBuilder()
                        .with_hit_points(1)
                        .with_max_hp(5)
                        .build())

        effect = Heal(duration = 0,
                      frequency = 0,
                      tick = 0,
                      healing = 10,
                      target = character)

        effect.trigger()

        assert_that(character.hit_points, is_(equal_to(5)))