Ejemplo n.º 1
0
    def test_pet_awake(self):
        frames_per_second, x_coordinate, y_coordinate = 30, 0, 0

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

        pet.set_state(ActorState.ASLEEP)

        assert pet.get_state() == ActorState.ASLEEP

        pet.awake()

        assert pet.get_state() == ActorState.AWAKE
Ejemplo n.º 2
0
    def test_pet_run_sleeping(self):
        frames_per_second, x_coordinate, y_coordinate = 30, 0, 0

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

        pet.energy = 10

        pet.run_turn()

        assert pet.get_state() == ActorState.ASLEEP
Ejemplo n.º 3
0
    def test_pet_run_poop(self):
        frames_per_second, x_coordinate, y_coordinate = 30, 0, 0

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

        pet.fullness = 70

        pet.run_turn()

        assert pet.get_state() == ActorState.POOPING