def test_hot_restore(self):
    tpl = {'heat_template_version': '2013-05-23', 'resources': {'A': {'type': 'ResourceWithRestoreType'}}}
    self.stack = stack.Stack(self.ctx, 'stack_details_test', template.Template(tpl))
    self.stack.store()
    self.stack.create()
    data = self.stack.prepare_abandon()
    data['resources']['A']['resource_data']['a_string'] = 'foo'
    fake_snapshot = collections.namedtuple('Snapshot', ('data', 'stack_id'))(data, self.stack.id)
    self.stack.restore(fake_snapshot)
    self.assertEqual((stack.Stack.RESTORE, stack.Stack.COMPLETE), self.stack.state)
    self.assertEqual('foo', self.stack.resources['A'].properties['a_string'])
def test_hot_restore(self):
    tpl = {'heat_template_version': '2013-05-23', 'resources': {'A': {'type': 'ResourceWithRestoreType'}}}
    self.stack = stack.Stack(self.ctx, 'stack_details_test', template.Template(tpl))
    self.stack.store()
    self.stack.create()
    data = self.stack.prepare_abandon()
    data['resources']['A']['resource_data']['a_string'] = 'foo'
    fake_snapshot = collections.namedtuple('Snapshot', ('data', 'stack_id'))(data, self.stack.id)
    self.stack.restore(fake_snapshot)
    self.assertEqual((stack.Stack.RESTORE, stack.Stack.COMPLETE), self.stack.state)
    self.assertEqual('foo', self.stack.resources['A'].properties['a_string'])