# Path: devicehive/device.py
# class DeviceError(ApiRequestError):
#     """Device error."""
# 
# Path: devicehive/subscription.py
# class SubscriptionError(ApiRequestError):
#     """Subscription error."""
# 
# Path: devicehive/api_response.py
# class ApiResponseError(TransportError):
#     """Api response error."""
# 
#     def __init__(self, message, transport_name, code, error):
#         message = '%s Transport: %s. Code: %s. Error: %s' % (message,
#                                                              transport_name,
#                                                              code, error)
#         super(ApiResponseError, self).__init__(message)
#         self._transport_name = transport_name
#         self._code = code
#         self._error = error
# 
#     @property
#     def transport_name(self):
#         return self._transport_name
# 
#     @property
#     def code(self):
#         return self._code
# 
#     @property
#     def error(self):
#         return self._error


from devicehive import DeviceError, SubscriptionError
from devicehive import ApiResponseError
    assert not list_notifications(device, start=server_timestamp,
                                  end=server_timestamp)
    notification_name = options[0]['notification']
    notification, = list_notifications(device,
                                       notification=notification_name)
    assert notification.notification == notification_name
    notification_0, notification_1 = list_notifications(
        device, sort_field='notification', sort_order='ASC')
    assert notification_0.notification == options[0]['notification']
    assert notification_1.notification == options[1]['notification']
    notification_0, notification_1 = list_notifications(
        device, sort_field='notification', sort_order='DESC')
    assert notification_0.notification == options[1]['notification']
    assert notification_1.notification == options[0]['notification']
    notification_name = test_id
    notification_0 = device.send_notification(notification_name)
    notification_1 = device.send_notification(notification_name)
    notification, = device.list_notifications(
        notification=notification_name, sort_field='timestamp',
        sort_order='ASC', take=1)
    assert notification.id == notification_0.id
    notification, = device.list_notifications(
        notification=notification_name, sort_field='timestamp',
        sort_order='ASC', take=1, skip=1)
    assert notification.id == notification_1.id
    device_1 = device_hive_api.get_device(test_id)
    device.remove()
    try:
        device.list_notifications()
        assert False

# Path: devicehive/device.py
# class DeviceError(ApiRequestError):
#     """Device error."""
# 
# Path: devicehive/subscription.py
# class SubscriptionError(ApiRequestError):
#     """Subscription error."""
# 
# Path: devicehive/api_response.py
# class ApiResponseError(TransportError):
#     """Api response error."""
# 
#     def __init__(self, message, transport_name, code, error):
#         message = '%s Transport: %s. Code: %s. Error: %s' % (message,
#                                                              transport_name,
#                                                              code, error)
#         super(ApiResponseError, self).__init__(message)
#         self._transport_name = transport_name
#         self._code = code
#         self._error = error
# 
#     @property
#     def transport_name(self):
#         return self._transport_name
# 
#     @property
#     def code(self):
#         return self._code
# 
#     @property
#     def error(self):
#         return self._error


# Path: tests/test_api_device.py
from devicehive import DeviceError, SubscriptionError
from devicehive import ApiResponseError

    assert not list_notifications(device, start=server_timestamp,
                                  end=server_timestamp)
    notification_name = options[0]['notification']
    notification, = list_notifications(device,
                                       notification=notification_name)
    assert notification.notification == notification_name
    notification_0, notification_1 = list_notifications(
        device, sort_field='notification', sort_order='ASC')
    assert notification_0.notification == options[0]['notification']
    assert notification_1.notification == options[1]['notification']
    notification_0, notification_1 = list_notifications(
        device, sort_field='notification', sort_order='DESC')
    assert notification_0.notification == options[1]['notification']
    assert notification_1.notification == options[0]['notification']
    notification_name = test_id
    notification_0 = device.send_notification(notification_name)
    notification_1 = device.send_notification(notification_name)
    notification, = device.list_notifications(
        notification=notification_name, sort_field='timestamp',
        sort_order='ASC', take=1)
    assert notification.id == notification_0.id
    notification, = device.list_notifications(
        notification=notification_name, sort_field='timestamp',
        sort_order='ASC', take=1, skip=1)
    assert notification.id == notification_1.id
    device_1 = device_hive_api.get_device(test_id)
    device.remove()
    try:
        device.list_notifications()
        assert False

    except DeviceError: