From c6c1cc9e8ad68c431debfa92cdf2d2b9aca53804 Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Wed, 29 Jul 2015 09:03:19 +0530 Subject: [PATCH] Fix `DummyResource missing in provider` error Change-Id: Ie1144702b9a6c008889116b408b4b09c3087d73e Closes-Bug: #1479185 --- heat/tests/test_provider_template.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/heat/tests/test_provider_template.py b/heat/tests/test_provider_template.py index f883c0b3c4..1394750cbc 100644 --- a/heat/tests/test_provider_template.py +++ b/heat/tests/test_provider_template.py @@ -279,12 +279,19 @@ class ProviderTemplateTest(common.HeatTestCase): provider = { 'HeatTemplateFormatVersion': '2012-12-12', 'Outputs': { - 'Blarg': {'Value': 'wibble'}, + 'Foo': {'Value': 'bar'}, }, } files = {'test_resource.template': json.dumps(provider)} + class DummyResource(object): + support_status = support.SupportStatus() + properties_schema = {} + attributes_schema = {"Foo": attributes.Schema( + "A test attribute")} + env = environment.Environment() + resource._register_class('DummyResource', DummyResource) env.load({'resource_registry': {'DummyResource': 'test_resource.template'}}) stack = parser.Stack(utils.dummy_context(), 'test_stack', @@ -298,12 +305,12 @@ class ProviderTemplateTest(common.HeatTestCase): definition, stack) self.assertIsNone(temp_res.validate()) nested = mock.Mock() - nested.outputs = {'Blarg': {'Value': 'not-this', - 'error_msg': 'it is all bad'}} + nested.outputs = {'Foo': {'Value': 'not-this', + 'error_msg': 'it is all bad'}} nested.output.return_value = None temp_res._nested = nested self.assertRaises(exception.InvalidTemplateAttribute, - temp_res.FnGetAtt, 'Blarg') + temp_res.FnGetAtt, 'Foo') def test_properties_normal(self): provider = {