def setUp(self): super(ServicesCellsTest, self).setUp() host_api = cells_api.HostAPI() self.controller = services.ServiceController() self.controller.host_api = host_api self.stubs.Set(timeutils, "utcnow", fake_utcnow) self.stubs.Set(timeutils, "utcnow_ts", fake_utcnow_ts) services_list = [] for service in fake_services_list: service = service.copy() service['id'] = 'cell1@%d' % service['id'] services_list.append(service) self.stubs.Set(host_api.cells_rpcapi, "service_get_all", fake_service_get_all(services_list))
def setUp(self): super(ServicesCellsTestV21, self).setUp() host_api = cells_api.HostAPI() self.ext_mgr = extensions.ExtensionManager() self.ext_mgr.extensions = {} self._set_up_controller() self.controller.host_api = host_api self.stubs.Set(timeutils, "utcnow", fake_utcnow) self.stubs.Set(timeutils, "utcnow_ts", fake_utcnow_ts) services_list = [] for service in fake_services_list: service = service.copy() service['id'] = 'cell1@%d' % service['id'] services_list.append(service) self.stubs.Set(host_api.cells_rpcapi, "service_get_all", fake_service_get_all(services_list))
def setUp(self): super(ServicesCellsTestV21, self).setUp() host_api = cells_api.HostAPI() self.ext_mgr = extensions.ExtensionManager() self.ext_mgr.extensions = {} self._set_up_controller() self.controller.host_api = host_api self.useFixture(utils_fixture.TimeFixture(fake_utcnow())) services_list = [] for service in fake_services_list: service = service.copy() del service['version'] service_obj = objects.Service(**service) service_proxy = cells_utils.ServiceProxy(service_obj, 'cell1') services_list.append(service_proxy) host_api.cells_rpcapi.service_get_all = ( mock.Mock(side_effect=fake_service_get_all(services_list)))
def setUp(self): super(ServicesCellsTestV21, self).setUp() host_api = cells_api.HostAPI() self.ext_mgr = extensions.ExtensionManager() self.ext_mgr.extensions = {} self._set_up_controller() self.controller.host_api = host_api self.stubs.Set(timeutils, "utcnow", fake_utcnow) self.stubs.Set(timeutils, "utcnow_ts", fake_utcnow_ts) services_list = [] for service in fake_services_list: service = service.copy() del service['version'] service_obj = objects.Service(**service) service_proxy = cells_utils.ServiceProxy(service_obj, 'cell1') services_list.append(service_proxy) self.stubs.Set(host_api.cells_rpcapi, "service_get_all", fake_service_get_all(services_list))