Пример #1
0
def test_fitness_update():
    """
    test fitness is updated when weight is changed
    """
    animal = Herbivore(10, 50)
    before_fitness = animal.fitness
    animal.lose_weight()
    assert animal.fitness != before_fitness
Пример #2
0
def test_animal_weight_loss():
    """
    Test if animal looses weight
    """
    animal = Herbivore(10, 50)
    before_weight = animal.weight
    animal.lose_weight()
    assert before_weight > animal.weight