def setUp(self): super(DisabledFlavorsWithRealDBTest, self).setUp() self.controller = flavors.Controller() # Add a new disabled type to the list of flavors self.req = fakes.HTTPRequest.blank('/v2/fake/flavors') self.context = self.req.environ['nova.context'] self.admin_context = context.get_admin_context() self.disabled_type = self._create_disabled_instance_type() self.inst_types = db.flavor_get_all(self.admin_context)
def setUp(self): super(FlavorsTest, self).setUp() self.flags(osapi_compute_extension=[]) fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(nova.compute.flavors, "get_all_flavors_sorted_list", fake_get_all_flavors_sorted_list) self.stubs.Set(nova.compute.flavors, "get_flavor_by_flavor_id", fake_flavor_get_by_flavor_id) self.controller = flavors.Controller()
def setUp(self): super(FlavorsTest, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(nova.compute.instance_types, "get_all_types", fake_instance_type_get_all) self.stubs.Set(nova.compute.instance_types, "get_instance_type_by_flavor_id", fake_instance_type_get_by_flavor_id) self.controller = flavors.Controller()
def setUp(self): super(FlavorAccessTest, self).setUp() self.flavor_controller = flavors_api.Controller() self.flavor_access_controller = flavor_access.FlavorAccessController() self.flavor_action_controller = flavor_access.FlavorActionController() self.req = FakeRequest() self.context = self.req.environ['nova.context'] self.stubs.Set(db, 'flavor_get_by_flavor_id', fake_get_flavor_by_flavor_id) self.stubs.Set(db, 'flavor_get_all', fake_get_all_flavors_sorted_list) self.stubs.Set(db, 'flavor_access_get_by_flavor_id', fake_get_flavor_access_by_flavor_id)
def setUp(self): super(FlavorAccessTest, self).setUp() self.flavor_controller = flavors.Controller() self.flavor_access_controller = flavor_access.FlavorAccessController() self.flavor_action_controller = flavor_access.FlavorActionController() self.req = FakeRequest() self.context = self.req.environ['nova.context'] self.stubs.Set(instance_types, 'get_instance_type_by_flavor_id', fake_get_instance_type_by_flavor_id) self.stubs.Set(instance_types, 'get_all_types', fake_get_all_types) self.stubs.Set(instance_types, 'get_instance_type_access_by_flavor_id', fake_get_instance_type_access_by_flavor_id)
def setUp(self): super(FlavorAccessTestV21, self).setUp() self.flavor_controller = flavors_api.Controller() self.req = FakeRequest() self.req.environ = {"nova.context": context.RequestContext('fake_user', 'fake')} self.stubs.Set(db, 'flavor_get_by_flavor_id', fake_get_flavor_by_flavor_id) self.stubs.Set(db, 'flavor_get_all', fake_get_all_flavors_sorted_list) self.stubs.Set(db, 'flavor_access_get_by_flavor_id', fake_get_flavor_access_by_flavor_id) self.flavor_access_controller = self.FlavorAccessController() self.flavor_action_controller = self.FlavorActionController()
def setUp(self): super(ParseIsPublicTest, self).setUp() self.controller = flavors.Controller()