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)
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)
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')
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()