def test_adopt_stack_rollback(self):
    adopt_data = '{\n                "name": "my-test-stack-name",\n                "resources": {}\n                }'
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    self.stack = stack.Stack(utils.dummy_context(), 'test_stack', tmpl, disable_rollback=False, adopt_stack_data=json.loads(adopt_data))
    self.stack.store()
    with mock.patch.object(self.stack, 'delete', side_effect=self.stack.delete) as mock_delete:
        self.stack.adopt()
        self.assertEqual((self.stack.ROLLBACK, self.stack.COMPLETE), self.stack.state)
        mock_delete.assert_called_once_with(action=self.stack.ROLLBACK, abandon=True)
def test_adopt_stack_rollback(self):
    adopt_data = '{\n                "name": "my-test-stack-name",\n                "resources": {}\n                }'
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    self.stack = stack.Stack(utils.dummy_context(), 'test_stack', tmpl, disable_rollback=False, adopt_stack_data=json.loads(adopt_data))
    self.stack.store()
    with mock.patch.object(self.stack, 'delete', side_effect=self.stack.delete) as mock_delete:
        self.stack.adopt()
        self.assertEqual((self.stack.ROLLBACK, self.stack.COMPLETE), self.stack.state)
        mock_delete.assert_called_once_with(action=self.stack.ROLLBACK, abandon=True)