From 4f3919e94ec072a475051afca1d87eba63f656f7 Mon Sep 17 00:00:00 2001 From: Sergey Kraynev Date: Tue, 9 Jun 2015 00:43:11 -0400 Subject: [PATCH] Register ResourceWithComplexAttributes in HeatTest Move registration of the ResourceWithComplexAttributes resource to the main test class. Change-Id: I85e175df4889db31adc02e325eed362d710baca0 --- heat/tests/common.py | 2 ++ heat/tests/test_hot.py | 4 ---- heat/tests/test_resource_group.py | 8 +------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/heat/tests/common.py b/heat/tests/common.py index cb068ab359..58f88f7cbb 100644 --- a/heat/tests/common.py +++ b/heat/tests/common.py @@ -129,6 +129,8 @@ class HeatTestCase(testscenarios.WithScenarios, generic_rsrc.ResourceWithResourceID) resource._register_class('ResWithComplexPropsAndAttrs', generic_rsrc.ResWithComplexPropsAndAttrs) + resource._register_class('ResourceWithComplexAttributesType', + generic_rsrc.ResourceWithComplexAttributes) def stub_wallclock(self): """ diff --git a/heat/tests/test_hot.py b/heat/tests/test_hot.py index 06a2285a6f..003141df90 100644 --- a/heat/tests/test_hot.py +++ b/heat/tests/test_hot.py @@ -900,8 +900,6 @@ class HotStackTest(common.HeatTestCase): generic_rsrc.GenericResource) resource._register_class('ResourceWithPropsType', generic_rsrc.ResourceWithProps) - resource._register_class('ResourceWithComplexAttributesType', - generic_rsrc.ResourceWithComplexAttributes) def resolve(self, snippet): return function.resolve(self.stack.t.parse(self.stack, snippet)) @@ -1139,8 +1137,6 @@ class StackAttributesTest(common.HeatTestCase): resource._register_class('GenericResourceType', generic_rsrc.GenericResource) - resource._register_class('ResourceWithComplexAttributesType', - generic_rsrc.ResourceWithComplexAttributes) self.m.ReplayAll() diff --git a/heat/tests/test_resource_group.py b/heat/tests/test_resource_group.py index 6640a97b0a..bb7a2fb3b0 100644 --- a/heat/tests/test_resource_group.py +++ b/heat/tests/test_resource_group.py @@ -98,7 +98,7 @@ template_attr = { "properties": { "count": 2, "resource_def": { - "type": "dummyattr.resource", + "type": "ResourceWithComplexAttributesType", "properties": { } } @@ -138,9 +138,6 @@ class ResourceGroupTest(common.HeatTestCase): ResourceWithPropsAndId) resource._register_class('dummy.listresource', ResourceWithListProp) - AttributeResource = generic_resource.ResourceWithComplexAttributes - resource._register_class("dummyattr.resource", - AttributeResource) self.m.StubOutWithMock(stackm.Stack, 'validate') def test_assemble_nested(self): @@ -507,9 +504,6 @@ class ResourceGroupAttrTest(common.HeatTestCase): super(ResourceGroupAttrTest, self).setUp() resource._register_class("dummy.resource", ResourceWithPropsAndId) - AttributeResource = generic_resource.ResourceWithComplexAttributes - resource._register_class("dummyattr.resource", - AttributeResource) def test_aggregate_attribs(self): """