Change ResDataNestedStackTest to not use a nested stack

It is testing that resource data is deleted, our stack's are
isolated enough now that this can just be tested in a single stack.

part of blueprint decouple-nested

Change-Id: I3a0ba30acbbbbf34a7551b1e87e7c837beee5b7e
This commit is contained in:
Angus Salkeld 2015-02-18 12:30:39 +10:00
parent 5f37259d9c
commit e916fa3b20

View File

@ -283,15 +283,14 @@ class ResDataResource(generic_rsrc.GenericResource):
self.data_set("test", 'A secret value', True)
class ResDataNestedStackTest(NestedStackTest):
nested_template = '''
class ResDataStackTest(common.HeatTestCase):
template = '''
HeatTemplateFormatVersion: "2012-12-12"
Parameters:
KeyName:
Type: String
Resources:
nested_res:
res:
Type: "res.data.resource"
Outputs:
Foo:
@ -299,22 +298,19 @@ Outputs:
'''
def setUp(self):
super(ResDataNestedStackTest, self).setUp()
super(ResDataStackTest, self).setUp()
resource._register_class("res.data.resource", ResDataResource)
def create_stack(self, template):
t = template_format.parse(template)
stack = self.parse_stack(t)
stack = utils.parse_stack(t)
stack.create()
self.assertEqual((stack.CREATE, stack.COMPLETE), stack.state)
return stack
def test_res_data_delete(self):
urlfetch.get('https://server.test/the.template').AndReturn(
self.nested_template)
self.m.ReplayAll()
stack = self.create_stack(self.test_template)
res = stack['the_nested'].nested()['nested_res']
stack = self.create_stack(self.template)
res = stack['res']
stack.delete()
self.assertEqual((stack.DELETE, stack.COMPLETE), stack.state)
self.assertRaises(exception.NotFound, db_api.resource_data_get, res,