Esempio n. 1
0
    def reset_task_status(self):
        self.mock.StubOutWithMock(MgmtInstance, "load")
        MgmtInstance.load(context=self.context, id=self.db_info.id).AndReturn(self.instance)
        self.mock.ReplayAll()

        req, body = self._make_request(context=self.context)
        self.controller = MgmtInstanceController()
        resp = self.controller.action(req, body, self.tenant_id, self.db_info.id)

        self.mock.UnsetStubs()
        self.mock.VerifyAll()
        return resp
Esempio n. 2
0
    def reset_task_status(self):
        self.mock.StubOutWithMock(MgmtInstance, 'load')
        MgmtInstance.load(context=self.context,
                          id=self.db_info.id).AndReturn(self.instance)
        self.mock.ReplayAll()

        req, body = self._make_request(context=self.context)
        self.controller = MgmtInstanceController()
        resp = self.controller.action(req, body, self.tenant_id,
                                      self.db_info.id)

        self.mock.UnsetStubs()
        self.mock.VerifyAll()
        return resp