# 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: devicehive/network.py
# class NetworkError(ApiRequestError):
#     """Network error."""
# 
# Path: devicehive/subscription.py
# class SubscriptionError(ApiRequestError):
#     """Subscription error."""


from devicehive import NetworkError, ApiResponseError, SubscriptionError
    network.description = description
    network.save()
    network_1 = device_hive_api.get_network(network.id)
    network.remove()
    try:
        network.save()
        assert False
    except NetworkError:
        pass
    try:
        network_1.save()
        assert False
    except ApiResponseError as api_response_error:
        assert api_response_error.code == 404


def test_remove(test):
    test.only_admin_implementation()
    device_hive_api = test.device_hive_api()
    name = test.generate_id('n-r', test.NETWORK_ENTITY)
    description = '%s-description' % name
    network = device_hive_api.create_network(name, description)
    network_1 = device_hive_api.get_network(network.id)
    network.remove()
    assert not network.id
    assert not network.name
    assert not network.description
    try:
        network.remove()
        assert False

# 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: devicehive/network.py
# class NetworkError(ApiRequestError):
#     """Network error."""
# 
# Path: devicehive/subscription.py
# class SubscriptionError(ApiRequestError):
#     """Subscription error."""


# Path: tests/test_api_network.py
from devicehive import NetworkError, ApiResponseError, SubscriptionError

    network.description = description
    network.save()
    network_1 = device_hive_api.get_network(network.id)
    network.remove()
    try:
        network.save()
        assert False
    except NetworkError:
        pass
    try:
        network_1.save()
        assert False
    except ApiResponseError as api_response_error:
        assert api_response_error.code == 404


def test_remove(test):
    test.only_admin_implementation()
    device_hive_api = test.device_hive_api()
    name = test.generate_id('n-r', test.NETWORK_ENTITY)
    description = '%s-description' % name
    network = device_hive_api.create_network(name, description)
    network_1 = device_hive_api.get_network(network.id)
    network.remove()
    assert not network.id
    assert not network.name
    assert not network.description
    try:
        network.remove()
        assert False

    except NetworkError: