def test_suspend_resume(self):
    tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
    self.stack = stack.Stack(self.ctx, 'suspend_test', template.Template(tmpl))
    self.stack.store()
    self.stack.create()
    self.assertEqual((self.stack.CREATE, self.stack.COMPLETE), self.stack.state)
    self.assertIsNone(self.stack.updated_time)
    self.stack.suspend()
    self.assertEqual((self.stack.SUSPEND, self.stack.COMPLETE), self.stack.state)
    stack_suspend_time = self.stack.updated_time
    self.assertIsNotNone(stack_suspend_time)
    self.stack.resume()
    self.assertEqual((self.stack.RESUME, self.stack.COMPLETE), self.stack.state)
    self.assertNotEqual(stack_suspend_time, self.stack.updated_time)
def test_suspend_resume(self):
    tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
    self.stack = stack.Stack(self.ctx, 'suspend_test', template.Template(tmpl))
    self.stack.store()
    self.stack.create()
    self.assertEqual((self.stack.CREATE, self.stack.COMPLETE), self.stack.state)
    self.assertIsNone(self.stack.updated_time)
    self.stack.suspend()
    self.assertEqual((self.stack.SUSPEND, self.stack.COMPLETE), self.stack.state)
    stack_suspend_time = self.stack.updated_time
    self.assertIsNotNone(stack_suspend_time)
    self.stack.resume()
    self.assertEqual((self.stack.RESUME, self.stack.COMPLETE), self.stack.state)
    self.assertNotEqual(stack_suspend_time, self.stack.updated_time)