summaryrefslogtreecommitdiff
path: root/heat/tests/test_resource.py
diff options
context:
space:
mode:
authorhuangtianhua <huangtianhua@huawei.com>2017-01-13 15:23:26 +0800
committerhuangtianhua <huangtianhua@huawei.com>2017-01-13 16:31:28 +0800
commitc1d6ee182d48040137444d03cb69fc182d286055 (patch)
tree57b0b08ab00eeefc2c5cb759b95e40c28c073f01 /heat/tests/test_resource.py
parentba551125d105fbf2cd4a308201e8cfb4a2a3a01d (diff)
downloadheat-c1d6ee182d48040137444d03cb69fc182d286055.tar.gz
Fix validate_external()
Not every resource has *entity* property, such neutron resources, so do not have to check it when validate external resource. Change-Id: I19a16f40ac6c19e61d4aafb0f083d3a943bd7cac Closes-Bug: #1656197
Diffstat (limited to 'heat/tests/test_resource.py')
-rw-r--r--heat/tests/test_resource.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/heat/tests/test_resource.py b/heat/tests/test_resource.py
index b7c9442ab..1af1213a2 100644
--- a/heat/tests/test_resource.py
+++ b/heat/tests/test_resource.py
@@ -352,16 +352,16 @@ class ResourceTest(common.HeatTestCase):
'test_resource', 'GenericResourceType',
external_id=external_id)
res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack)
- res.entity = 'test'
res.client_plugin = mock.Mock()
self.patchobject(res.client_plugin, 'is_not_found',
return_value=True)
self.patchobject(res, '_show_resource', side_effect=Exception())
e = self.assertRaises(exception.StackValidationFailed,
res.validate_external)
- message = ("Invalid external resource: Resource %(external_id)s not "
- "found in %(entity)s.") % {'external_id': external_id,
- 'entity': res.entity}
+ message = (("Invalid external resource: Resource %(external_id)s "
+ "(%(type)s) can not be found.") %
+ {'external_id': external_id,
+ 'type': res.type()})
self.assertEqual(message, six.text_type(e))
def test_updated_from_external(self):