def test_extensions_inherit(self, mock_register, mock_get_client): app = ha.APIRouterV1() self.assertIn('extensions', app._loaded_extension_info.extensions) ext_no_inherits = mock_register.call_args_list[0][0][0] mock_register.assert_called_with(mock.ANY, mock.ANY) name_list = [ext.obj.alias for ext in ext_no_inherits] self.assertIn('extensions', name_list)
def wsgi_app_v1(fake_auth_context=None, init_only=None): inner_app_v1 = ha.APIRouterV1() if fake_auth_context is not None: ctxt = fake_auth_context else: ctxt = context.RequestContext('fake', 'fake', auth_token=True) api_v1 = (openstack_api.FaultWrapper( api_auth.InjectContext(ctxt, inner_app_v1))) mapper = urlmap.URLMap() mapper['/v1'] = api_v1 mapper['/'] = openstack_api.FaultWrapper(versions.Versions()) return mapper
def test_extensions_loaded(self, mock_get_client): app = ha.APIRouterV1() self.assertIn('extensions', app._loaded_extension_info.extensions)