Пример #1
0
    def test_pet_run_die_hunger(self):
        frames_per_second, x_coordinate, y_coordinate = 30, 0, 0

        pet = Pet(frames_per_second, Coordinate(x_coordinate, y_coordinate))

        pet.health = 0

        pet.run_turn()

        assert pet.is_alive() == False
Пример #2
0
    def test_pet_eating_low_health(self):
        frames_per_second, x_coordinate, y_coordinate = 30, 0, 0

        pet = Pet(frames_per_second, Coordinate(x_coordinate, y_coordinate))

        new_health = 10
        pet.health = new_health

        example_food = ExampleFood()

        pet.eat(example_food)

        assert pet.fullness == example_food.get_consumable_weight()
        assert pet.get_health(
        ) == ExampleFood().get_consumable_value() + new_health