def test_check_reservation_ok(service: UpdateRoomClose, context: Context, house, reservation): context.house = house context.source = reservation result = service.check_reservation(context) assert is_successful(result)
def test_check_reservation_not_close_room(service: UpdateRoomClose, context: Context, house, reservation): context.house = house context.source = attr.evolve(reservation, status=ReservationStatuses.NEW) result = service.check_reservation(context) assert not is_successful(result) assert result.failure().failure == ReservationErrors.missed_reservation