from src.gameplay.healing.utils.potions import matchHpHealing


def test_matches_absolute_health_threshold():
    healing = {'hpLessThanOrEqual': 150, 'hpPercentageLessThanOrEqual': 0}

    assert matchHpHealing(healing, {'hp': 150, 'hpPercentage': 80}) is True
    assert matchHpHealing(healing, {'hp': 151, 'hpPercentage': 10}) is False
    assert matchHpHealing(healing, {'hp': None, 'hpPercentage': None}) is False
