# Path: heatclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class HTTPException(BaseException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class NoUniqueMatch(HTTPException):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPUnsupported(HTTPException):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class StackFailure(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message=None, code=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):
# 
# Path: heatclient/v1/services.py
# class Service(base.Resource):
# class ServiceManager(base.BaseManager):
#     def __repr__(self):
#     def list(self):


import testtools
from heatclient import exc
from heatclient.v1 import services
#    License for the specific language governing permissions and limitations
#    under the License.




class ManageServiceTest(testtools.TestCase):
    def setUp(self):
        super(ManageServiceTest, self).setUp()

    def test_service_list(self):
        class FakeResponse(object):
            def json(self):
                return {'services': []}

        class FakeClient(object):
            def get(self, *args, **kwargs):
                assert args[0] == ('/services')
                return FakeResponse()

        manager = services.ServiceManager(FakeClient())
        self.assertEqual([], manager.list())

    def test_service_list_403(self):
        class FakeClient403(object):

            def get(self, *args, **kwargs):
                assert args[0] == ('/services')
                raise exc.HTTPForbidden()


# Path: heatclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class HTTPException(BaseException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class NoUniqueMatch(HTTPException):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPUnsupported(HTTPException):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class StackFailure(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message=None, code=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):
# 
# Path: heatclient/v1/services.py
# class Service(base.Resource):
# class ServiceManager(base.BaseManager):
#     def __repr__(self):
#     def list(self):


# Path: heatclient/tests/unit/test_service.py
import testtools
from heatclient import exc
from heatclient.v1 import services

#    License for the specific language governing permissions and limitations
#    under the License.




class ManageServiceTest(testtools.TestCase):
    def setUp(self):
        super(ManageServiceTest, self).setUp()

    def test_service_list(self):
        class FakeResponse(object):
            def json(self):
                return {'services': []}

        class FakeClient(object):
            def get(self, *args, **kwargs):
                assert args[0] == ('/services')
                return FakeResponse()

        manager = services.ServiceManager(FakeClient())
        self.assertEqual([], manager.list())

    def test_service_list_403(self):
        class FakeClient403(object):

            def get(self, *args, **kwargs):
                assert args[0] == ('/services')
                raise exc.HTTPForbidden()


        manager = services.ServiceManager(FakeClient403())