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(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)