def setUp(self): super(InstanceActionsTest, self).setUp() self.controller = instance_actions.InstanceActionsController() self.fake_actions = copy.deepcopy(fake_instance_actions.FAKE_ACTIONS) self.fake_events = copy.deepcopy(fake_instance_actions.FAKE_EVENTS) def fake_get(self, context, instance_uuid): return {'uuid': instance_uuid} def fake_instance_get_by_uuid(context, instance_id): return {'name': 'fake', 'project_id': context.project_id} self.stubs.Set(compute_api.API, 'get', fake_get) self.stubs.Set(db, 'instance_get_by_uuid', fake_instance_get_by_uuid)
def setUp(self): super(InstanceActionsPolicyTest, self).setUp() self.controller = instance_actions.InstanceActionsController()