def setUp(self): super(AvailabilityZoneApiTest, self).setUp() availability_zones.reset_cache() self.stubs.Set(db, 'service_get_all', fake_service_get_all) self.stubs.Set(availability_zones, 'set_availability_zones', fake_set_availability_zones) self.stubs.Set(servicegroup.API, 'service_is_up', fake_service_is_up)
def setUp(self): super(AvailabilityZoneApiTestV21, self).setUp() availability_zones.reset_cache() self.stubs.Set(db, 'service_get_all', fake_service_get_all) self.stubs.Set(availability_zones, 'set_availability_zones', fake_set_availability_zones) self.stubs.Set(servicegroup.API, 'service_is_up', fake_service_is_up)
def setUp(self): super(ExtendedServerAttributesTest, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self.stubs) self.stubs.Set(compute.api.API, 'get', fake_compute_get) self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all) self.stubs.Set(availability_zones, 'get_host_availability_zone', fake_get_host_availability_zone)
def setUp(self): super(ExtendedServerAttributesTest, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self.stubs) self.stubs.Set(compute.api.API, "get", fake_compute_get) self.stubs.Set(compute.api.API, "get_all", fake_compute_get_all) self.stubs.Set(availability_zones, "get_host_availability_zone", fake_get_host_availability_zone) return_server = fakes.fake_instance_get() self.stubs.Set(db, "instance_get_by_uuid", return_server)
def setUp(self): super(AvailabilityZoneApiTestV21, self).setUp() availability_zones.reset_cache() self.stubs.Set(db, 'service_get_all', fake_service_get_all) self.stubs.Set(availability_zones, 'set_availability_zones', fake_set_availability_zones) self.stubs.Set(servicegroup.API, 'service_is_up', fake_service_is_up) self.controller = self.availability_zone.AvailabilityZoneController() self.req = fakes.HTTPRequest.blank('')
def setUp(self): super(ExtendedServerAttributesTest, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self.stubs) self.stubs.Set(compute.api.API, 'get', fake_compute_get) self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all) self.stubs.Set(availability_zones, 'get_host_availability_zone', fake_get_host_availability_zone) return_server = fakes.fake_instance_get() self.stubs.Set(db, 'instance_get_by_uuid', return_server)
def setUp(self): super(ExtendedAvailabilityZoneTestV21, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self) self.stubs.Set(compute.api.API, 'get', fake_compute_get) self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all) self.stubs.Set(availability_zones, 'get_host_availability_zone', fake_get_host_availability_zone) return_server = fakes.fake_instance_get() self.stub_out('nova.db.instance_get_by_uuid', return_server)
def setUp(self): super(ExtendedAvailabilityZoneTestV21, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self.stubs) self.stubs.Set(compute.api.API, 'get', fake_compute_get) self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all) self.stubs.Set(availability_zones, 'get_host_availability_zone', fake_get_host_availability_zone) return_server = fakes.fake_instance_get() self.stubs.Set(db, 'instance_get_by_uuid', return_server)
def setUp(self): super(AvailabilityZoneApiTestV21, self).setUp() availability_zones.reset_cache() self.stubs.Set(db, 'service_get_all', fake_service_get_all) self.stubs.Set(availability_zones, 'set_availability_zones', fake_set_availability_zones) self.stubs.Set(servicegroup.API, 'service_is_up', fake_service_is_up) self.controller = self.availability_zone.AvailabilityZoneController() self.admin_webreq = webob.Request.blank('') self.admin_webreq.environ['nova.context'] = context.get_admin_context()
def setUp(self): super(AvailabilityZoneApiTestV21, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self) self.stub_out('nova.db.api.service_get_all', fake_service_get_all) self.stub_out('nova.availability_zones.set_availability_zones', lambda c, services: services) self.stub_out('nova.servicegroup.API.service_is_up', lambda s, service: service['binary'] != u"nova-network") self.controller = self.availability_zone.AvailabilityZoneController() self.req = fakes.HTTPRequest.blank('')
def setUp(self): super(ExtendedAvailabilityZoneTestV21, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self) fakes.stub_out_secgroup_api(self) self.stub_out('nova.compute.api.API.get', fake_compute_get) self.stub_out('nova.compute.api.API.get_all', fake_compute_get_all) self.stub_out('nova.availability_zones.get_host_availability_zone', fake_get_host_availability_zone) return_server = fakes.fake_instance_get() self.stub_out('nova.db.instance_get_by_uuid', return_server)
def setUp(self): super(AvailabilityZoneApiTestV21, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self) self.stub_out('nova.availability_zones.set_availability_zones', lambda c, services: services) self.stub_out('nova.servicegroup.API.service_is_up', lambda s, service: True) self.controller = self.availability_zone.AvailabilityZoneController() self.mock_service_get_all = mock.patch.object( self.controller.host_api, 'service_get_all', side_effect=fake_service_get_all).start() self.addCleanup(self.mock_service_get_all.stop)
def setUp(self): super(ExtendedServerAttributesTest, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self.stubs) self.stubs.Set(compute.api.API, 'get', fake_compute_get) self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all) self.stubs.Set(availability_zones, 'get_host_availability_zone', fake_get_host_availability_zone) self.flags( osapi_compute_extension=[ 'nova.api.openstack.compute.contrib.select_extensions'], osapi_compute_ext_list=['Extended_availability_zone'])
def setUp(self): super(AvailabilityZoneApiTestV21, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self) self.stub_out('nova.availability_zones.set_availability_zones', lambda c, services: services) self.stub_out('nova.servicegroup.API.service_is_up', lambda s, service: service['binary'] != u"nova-network") self.controller = self.availability_zone.AvailabilityZoneController() self.mock_service_get_all = mock.patch.object( self.controller.host_api, 'service_get_all', side_effect=fake_service_get_all).start() self.addCleanup(self.mock_service_get_all.stop) self.req = fakes.HTTPRequest.blank('')
def setUp(self): super(ExtendedAvailabilityZoneTest, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self.stubs) self.stubs.Set(compute.api.API, 'get', fake_compute_get) self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all) self.stubs.Set(availability_zones, 'get_host_availability_zone', fake_get_host_availability_zone) return_server = fakes.fake_instance_get() self.stubs.Set(db, 'instance_get_by_uuid', return_server) self.flags( osapi_compute_extension=[ 'nova.api.openstack.compute.contrib.select_extensions'], osapi_compute_ext_list=['Extended_availability_zone'])
def setUp(self): super(ExtendedServerAttributesTest, self).setUp() availability_zones.reset_cache() fakes.stub_out_nw_api(self.stubs) self.stubs.Set(compute.api.API, 'get', fake_compute_get) self.stubs.Set(compute.api.API, 'get_all', fake_compute_get_all) self.stubs.Set(availability_zones, 'get_host_availability_zone', fake_get_host_availability_zone) return_server = fakes.fake_instance_get() self.stubs.Set(db, 'instance_get_by_uuid', return_server) self.flags(osapi_compute_extension=[ 'nova.api.openstack.compute.contrib.select_extensions' ], osapi_compute_ext_list=['Extended_availability_zone'])
def test_rest_availability_zone_reset_cache(self): az._get_cache().add('cache', 'fake_value') az.reset_cache() self.assertIsNone(az._get_cache().get('cache'))
def test_rest_availability_zone_reset_cache(self): az.reset_cache() self.assertEqual(az._get_cache().get("cache"), None)
def test_rest_availability_zone_reset_cache(self): az.reset_cache() self.assertEqual(az._get_cache().get('cache'), None)
def test_rest_availability_zone_reset_cache(self): az._get_cache().region.get_or_create('cache', lambda: 'fake_value') az.reset_cache() self.assertIsNone(az._get_cache().get('cache'))
def test_rest_availability_zone_reset_cache(self): az._get_cache().add("cache", "fake_value") az.reset_cache() self.assertIsNone(az._get_cache().get("cache"))