Esempio n. 1
0
    def setUp(self):
        super(ApiV2TestCase, self).setUp()

        # Ensure the v2 API is enabled
        self.config(enable_api_v2=True, group='service:api')

        # Create the application
        self.app = api_v2.factory({})

        # Inject the NormalizeURIMiddleware middleware
        self.app = middleware.NormalizeURIMiddleware(self.app)

        # Inject the ValidationError middleware
        self.app = middleware.APIv2ValidationErrorMiddleware(self.app)

        # Inject the FaultWrapper middleware
        self.app = middleware.FaultWrapperMiddleware(self.app)

        # Inject the TestContext middleware
        self.app = middleware.TestContextMiddleware(self.app,
                                                    self.admin_context.tenant,
                                                    self.admin_context.tenant)

        # Obtain a test client
        self.client = TestApp(self.app)
Esempio n. 2
0
    def setUp(self):
        super(ApiV2TestCase, self).setUp()

        # Ensure the v2 API is enabled
        self.config(enable_api_v2=True, group='service:api')

        # Create the application
        self.app = api_v2.factory({})

        # Inject the NormalizeURIMiddleware middleware
        self.app = middleware.NormalizeURIMiddleware(self.app)

        # Inject the ValidationError middleware
        self.app = middleware.APIv2ValidationErrorMiddleware(self.app)

        # Inject the FaultWrapper middleware
        self.app = middleware.FaultWrapperMiddleware(self.app)

        # Inject the TestContext middleware
        self.app = middleware.TestContextMiddleware(
            self.app, self.admin_context.tenant,
            self.admin_context.tenant)

        # Obtain a test client
        self.client = TestApp(self.app)
Esempio n. 3
0
    def setUp(self):
        super(ApiV2TestCase, self).setUp()

        # Ensure the v2 API is enabled
        self.config(enable_api_v2=True, group='service:api')

        # Create the application
        self.app = api_v2.factory({})

        # Inject the FaultWrapper middleware
        self.app = middleware.FaultWrapperMiddleware(self.app)

        # Inject the NoAuth middleware
        self.app = middleware.NoAuthContextMiddleware(self.app)

        # Obtain a test client
        self.client = TestApp(self.app)

        # Create and start an instance of the central service
        self.central_service = self.start_service('central')
Esempio n. 4
0
    def setUp(self):
        super(ApiV2TestCase, self).setUp()

        # Ensure the v2 API is enabled
        self.config(enable_api_v2=True, group='service:api')

        # Create the application
        self.app = api_v2.factory({})

        # Inject the FaultWrapper middleware
        self.app = middleware.FaultWrapperMiddleware(self.app)

        # Inject the NoAuth middleware
        self.app = middleware.NoAuthContextMiddleware(self.app)

        # Obtain a test client
        self.client = TestApp(self.app)

        # Create and start an instance of the central service
        self.central_service = self.get_central_service()
        self.central_service.start()