From ce7ad1095f6b2c47f20faf117eb5ae0a3f5454ed Mon Sep 17 00:00:00 2001 From: Sergey Kraynev Date: Tue, 9 Jun 2015 01:09:15 -0400 Subject: [PATCH] Register ResourceWithProps in HeatTestCase Move registration of the ResourceWithProps resource to the main test class. Change-Id: I9acf89e18d9f84eae4ad00432f0a438b8f84fa5f --- heat/tests/common.py | 2 ++ heat/tests/test_engine_service.py | 6 ------ heat/tests/test_hot.py | 2 -- heat/tests/test_resource.py | 2 -- heat/tests/test_stack.py | 2 -- heat/tests/test_stack_collect_attributes.py | 4 ---- heat/tests/test_stack_update.py | 2 -- 7 files changed, 2 insertions(+), 18 deletions(-) diff --git a/heat/tests/common.py b/heat/tests/common.py index 58f88f7cbb..4933e5a28e 100644 --- a/heat/tests/common.py +++ b/heat/tests/common.py @@ -125,6 +125,8 @@ class HeatTestCase(testscenarios.WithScenarios, self.addCleanup(utils.reset_dummy_db) def register_test_resources(self): + resource._register_class('ResourceWithPropsType', + generic_rsrc.ResourceWithProps) resource._register_class('ResourceWithResourceIDType', generic_rsrc.ResourceWithResourceID) resource._register_class('ResWithComplexPropsAndAttrs', diff --git a/heat/tests/test_engine_service.py b/heat/tests/test_engine_service.py index 7b75a1b713..9f1065bc3c 100644 --- a/heat/tests/test_engine_service.py +++ b/heat/tests/test_engine_service.py @@ -942,8 +942,6 @@ class StackServiceAdoptUpdateTest(common.HeatTestCase): def test_stack_update_stack_id_equal(self): stack_name = 'test_stack_update_stack_id_equal' - res._register_class('ResourceWithPropsType', - generic_rsrc.ResourceWithProps) tpl = { 'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { @@ -1256,8 +1254,6 @@ class StackServiceAuthorizeTest(common.HeatTestCase): self.eng = service.EngineService('a-host', 'a-topic') self.eng.engine_id = 'engine-fake-uuid' cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role') - res._register_class('ResourceWithPropsType', - generic_rsrc.ResourceWithProps) @tools.stack_context('service_authorize_stack_user_nocreds_test_stack') def test_stack_authorize_stack_user_nocreds(self): @@ -1348,8 +1344,6 @@ class StackServiceTest(common.HeatTestCase): self.eng.create_periodic_tasks() self.eng.engine_id = 'engine-fake-uuid' cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role') - res._register_class('ResourceWithPropsType', - generic_rsrc.ResourceWithProps) @mock.patch.object(service_stack_watch.StackWatch, 'start_watch_task') @mock.patch.object(stack_object.Stack, 'get_all') diff --git a/heat/tests/test_hot.py b/heat/tests/test_hot.py index 003141df90..d27a13c76c 100644 --- a/heat/tests/test_hot.py +++ b/heat/tests/test_hot.py @@ -898,8 +898,6 @@ class HotStackTest(common.HeatTestCase): resource._register_class('GenericResourceType', generic_rsrc.GenericResource) - resource._register_class('ResourceWithPropsType', - generic_rsrc.ResourceWithProps) def resolve(self, snippet): return function.resolve(self.stack.t.parse(self.stack, snippet)) diff --git a/heat/tests/test_resource.py b/heat/tests/test_resource.py index 7719279d18..264bab47f7 100644 --- a/heat/tests/test_resource.py +++ b/heat/tests/test_resource.py @@ -1559,8 +1559,6 @@ class ResourceDependenciesTest(common.HeatTestCase): resource._register_class('GenericResourceType', generic_rsrc.GenericResource) - resource._register_class('ResourceWithPropsType', - generic_rsrc.ResourceWithProps) self.deps = dependencies.Dependencies() diff --git a/heat/tests/test_stack.py b/heat/tests/test_stack.py index 3e1563d94a..2711a175e1 100644 --- a/heat/tests/test_stack.py +++ b/heat/tests/test_stack.py @@ -55,8 +55,6 @@ class StackTest(common.HeatTestCase): resource._register_class('GenericResourceType', generic_rsrc.GenericResource) - resource._register_class('ResourceWithPropsType', - generic_rsrc.ResourceWithProps) def test_stack_reads_tenant(self): self.stack = stack.Stack(self.ctx, 'test_stack', self.tmpl, diff --git a/heat/tests/test_stack_collect_attributes.py b/heat/tests/test_stack_collect_attributes.py index 99099d1f73..9f5dd030e7 100644 --- a/heat/tests/test_stack_collect_attributes.py +++ b/heat/tests/test_stack_collect_attributes.py @@ -14,11 +14,9 @@ import six from heat.common import template_format -from heat.engine import resource from heat.engine import stack from heat.engine import template from heat.tests import common -from heat.tests import generic_resource as generic_rsrc from heat.tests import utils @@ -167,8 +165,6 @@ class DepAttrsTest(common.HeatTestCase): def setUp(self): super(DepAttrsTest, self).setUp() self.ctx = utils.dummy_context() - resource._register_class('ResourceWithPropsType', - generic_rsrc.ResourceWithProps) def test_dep_attrs(self): diff --git a/heat/tests/test_stack_update.py b/heat/tests/test_stack_update.py index 11d968d354..d15dbc3293 100644 --- a/heat/tests/test_stack_update.py +++ b/heat/tests/test_stack_update.py @@ -39,8 +39,6 @@ class StackUpdateTest(common.HeatTestCase): resource._register_class('GenericResourceType', generic_rsrc.GenericResource) - resource._register_class('ResourceWithPropsType', - generic_rsrc.ResourceWithProps) def test_update_add(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12',