summaryrefslogtreecommitdiff
path: root/heat/tests/test_template.py
diff options
context:
space:
mode:
authorhuangtianhua <huangtianhua@huawei.com>2016-02-23 17:03:10 +0800
committerhuangtianhua <huangtianhua@huawei.com>2016-08-25 01:14:14 +0000
commit4c4d790c62f0517cda70aa2ab82fdd257de3ef43 (patch)
tree711e56e39b8c574012b558fc73a3ec5d8329fa39 /heat/tests/test_template.py
parent4af3247843fbc8e1c3574f0bebbdb41b0ced67cc (diff)
downloadheat-4c4d790c62f0517cda70aa2ab82fdd257de3ef43.tar.gz
Provides 'if' intrinsic function
Provides condition function 'if' for templates: AWSTemplateFormatVersion.2010-09-09 heat_template_version.2016-10-14 Change-Id: I34c342de176bc87c9cde41aa32478e386f045422 Blueprint: support-conditions-function
Diffstat (limited to 'heat/tests/test_template.py')
-rw-r--r--heat/tests/test_template.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/heat/tests/test_template.py b/heat/tests/test_template.py
index d6f12b680..c3af2076e 100644
--- a/heat/tests/test_template.py
+++ b/heat/tests/test_template.py
@@ -325,7 +325,8 @@ class TestTemplateConditionParser(common.HeatTestCase):
{'get_attr': [None, 'att']}]}}}
# test with get_attr in equals
tmpl = template.Template(t)
- stk = stack.Stack(self.ctx, 'test_condition_with_get_attr_func', tmpl)
+ stk = stack.Stack(self.ctx, 'test_condition_with_get_attr_func', tmpl,
+ resolve_data=False)
ex = self.assertRaises(exception.InvalidConditionFunction,
tmpl.resolve_conditions, stk)
self.assertIn('The function is not supported in condition: get_attr',
@@ -333,7 +334,8 @@ class TestTemplateConditionParser(common.HeatTestCase):
# test with get_resource in top level of a condition
tmpl.t['conditions']['prod_env'] = {'get_resource': 'R1'}
- stk = stack.Stack(self.ctx, 'test_condition_with_get_attr_func', tmpl)
+ stk = stack.Stack(self.ctx, 'test_condition_with_get_attr_func', tmpl,
+ resolve_data=False)
ex = self.assertRaises(exception.InvalidConditionFunction,
tmpl.resolve_conditions, stk)
self.assertIn('The function is not supported in condition: '
@@ -341,7 +343,8 @@ class TestTemplateConditionParser(common.HeatTestCase):
# test with get_attr in top level of a condition
tmpl.t['conditions']['prod_env'] = {'get_attr': [None, 'att']}
- stk = stack.Stack(self.ctx, 'test_condition_with_get_attr_func', tmpl)
+ stk = stack.Stack(self.ctx, 'test_condition_with_get_attr_func', tmpl,
+ resolve_data=False)
ex = self.assertRaises(exception.InvalidConditionFunction,
tmpl.resolve_conditions, stk)
self.assertIn('The function is not supported in condition: get_attr',