Register ResWithComplexPropsAndAttrs in HeatTest

Move registration of the ResWithComplexPropsAndAttrs resource to the main
test class.

Change-Id: I98a8ef39f36d85a163c5ec6c78ebd013e91ade2d
This commit is contained in:
Sergey Kraynev 2015-06-08 11:59:29 -04:00
parent 7d9b5a265f
commit a520f7193e
5 changed files with 4 additions and 14 deletions

View File

@ -127,6 +127,8 @@ class HeatTestCase(testscenarios.WithScenarios,
def register_test_resources(self):
resource._register_class('ResourceWithResourceIDType',
generic_rsrc.ResourceWithResourceID)
resource._register_class('ResWithComplexPropsAndAttrs',
generic_rsrc.ResWithComplexPropsAndAttrs)
def stub_wallclock(self):
"""

View File

@ -50,8 +50,6 @@ class FormatTest(common.HeatTestCase):
})
resource._register_class('GenericResourceType',
generic_rsrc.GenericResource)
resource._register_class('ResWithComplexPropsAndAttrs',
generic_rsrc.ResWithComplexPropsAndAttrs)
self.stack = parser.Stack(utils.dummy_context(), 'test_stack',
tmpl, stack_id=str(uuid.uuid4()))

View File

@ -74,9 +74,9 @@ hot_tpl_mapped_props = template_format.parse('''
heat_template_version: 2013-05-23
resources:
resource1:
type: ResWithComplexPropsAndAttrsType
type: ResWithComplexPropsAndAttrs
resource2:
type: ResWithComplexPropsAndAttrsType
type: ResWithComplexPropsAndAttrs
properties:
a_list: { get_attr: [ resource1, list] }
a_string: { get_attr: [ resource1, string ] }
@ -902,8 +902,6 @@ class HotStackTest(common.HeatTestCase):
generic_rsrc.ResourceWithProps)
resource._register_class('ResourceWithComplexAttributesType',
generic_rsrc.ResourceWithComplexAttributes)
resource._register_class('ResWithComplexPropsAndAttrs',
generic_rsrc.ResWithComplexPropsAndAttrs)
def resolve(self, snippet):
return function.resolve(self.stack.t.parse(self.stack, snippet))
@ -1143,8 +1141,6 @@ class StackAttributesTest(common.HeatTestCase):
generic_rsrc.GenericResource)
resource._register_class('ResourceWithComplexAttributesType',
generic_rsrc.ResourceWithComplexAttributes)
resource._register_class('ResWithComplexPropsAndAttrsType',
generic_rsrc.ResWithComplexPropsAndAttrs)
self.m.ReplayAll()
@ -1235,8 +1231,6 @@ class StackGetAttrValidationTest(common.HeatTestCase):
resource._register_class('GenericResourceType',
generic_rsrc.GenericResource)
resource._register_class('ResWithComplexPropsAndAttrsType',
generic_rsrc.ResWithComplexPropsAndAttrs)
def test_validate_props_from_attrs(self):
stack = parser.Stack(self.ctx, 'test_props_from_attrs',

View File

@ -57,8 +57,6 @@ class StackTest(common.HeatTestCase):
generic_rsrc.GenericResource)
resource._register_class('ResourceWithPropsType',
generic_rsrc.ResourceWithProps)
resource._register_class('ResWithComplexPropsAndAttrs',
generic_rsrc.ResWithComplexPropsAndAttrs)
def test_stack_reads_tenant(self):
self.stack = stack.Stack(self.ctx, 'test_stack', self.tmpl,

View File

@ -41,8 +41,6 @@ class StackUpdateTest(common.HeatTestCase):
generic_rsrc.GenericResource)
resource._register_class('ResourceWithPropsType',
generic_rsrc.ResourceWithProps)
resource._register_class('ResWithComplexPropsAndAttrs',
generic_rsrc.ResWithComplexPropsAndAttrs)
def test_update_add(self):
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',