Register ResourceWithProps in HeatTestCase
Move registration of the ResourceWithProps resource to the main test class. Change-Id: I9acf89e18d9f84eae4ad00432f0a438b8f84fa5f
This commit is contained in:
parent
4f3919e94e
commit
ce7ad1095f
@ -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',
|
||||
|
@ -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')
|
||||
|
@ -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))
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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):
|
||||
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user