def test_resume_timeout(self):
    tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
    exc = scheduler.Timeout('foo', 0)
    self.patchobject(generic_rsrc.GenericResource, 'handle_resume', side_effect=exc)
    self.stack = stack.Stack(self.ctx, 'resume_test_fail_timeout', template.Template(tmpl))
    self.stack.store()
    self.stack.create()
    self.assertEqual((self.stack.CREATE, self.stack.COMPLETE), self.stack.state)
    self.stack.suspend()
    self.assertEqual((self.stack.SUSPEND, self.stack.COMPLETE), self.stack.state)
    self.stack.resume()
    self.assertEqual((self.stack.RESUME, self.stack.FAILED), self.stack.state)
    self.assertEqual('Resume timed out', self.stack.status_reason)
    generic_rsrc.GenericResource.handle_resume.assert_called_once_with()
def test_resume_timeout(self):
    tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
    exc = scheduler.Timeout('foo', 0)
    self.patchobject(generic_rsrc.GenericResource, 'handle_resume', side_effect=exc)
    self.stack = stack.Stack(self.ctx, 'resume_test_fail_timeout', template.Template(tmpl))
    self.stack.store()
    self.stack.create()
    self.assertEqual((self.stack.CREATE, self.stack.COMPLETE), self.stack.state)
    self.stack.suspend()
    self.assertEqual((self.stack.SUSPEND, self.stack.COMPLETE), self.stack.state)
    self.stack.resume()
    self.assertEqual((self.stack.RESUME, self.stack.FAILED), self.stack.state)
    self.assertEqual('Resume timed out', self.stack.status_reason)
    generic_rsrc.GenericResource.handle_resume.assert_called_once_with()