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(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 test_rest_availability_zone_reset_cache(self): az._get_cache().add('cache', 'fake_value') az.reset_cache() self.assertIsNone(az._get_cache().get('cache'))