summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tests/test_functions.py
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2017-07-17 16:29:36 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2017-07-17 16:29:36 +0800
commit040e0718bcfac3cd01cf4ccae82bef2c0d01087b (patch)
tree0835e86f3e1a0c63db180335e94628915a229ee5 /tosca2heat/tosca-parser/toscaparser/tests/test_functions.py
parent859e2826074aa51e0334d4607ccfcde5972e882e (diff)
synchronize upstream about tosca-parser
synchronize tosca-parser with version of 0.81 JIRA: PARSER-128 Change-Id: Ib00e391bd6c1f4c69776796eb7b28062f14b92fc Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tests/test_functions.py')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/test_functions.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/test_functions.py b/tosca2heat/tosca-parser/toscaparser/tests/test_functions.py
index fa60140..2e1d71e 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/test_functions.py
+++ b/tosca2heat/tosca-parser/toscaparser/tests/test_functions.py
@@ -188,6 +188,26 @@ class IntrinsicFunctionsTest(TestCase):
self.assertIsInstance(source_port, functions.GetProperty)
self.assertEqual(3306, source_port.result())
+ def test_get_prop_cap_host(self):
+ tosca_tpl = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ "data/functions/test_get_prop_cap_host.yaml")
+ some_node = self._get_node('some_node',
+ ToscaTemplate(tosca_tpl))
+ some_prop = some_node.get_properties()['some_prop']
+ self.assertIsInstance(some_prop.value, functions.GetProperty)
+ self.assertEqual('someval', some_prop.value.result())
+
+ def test_get_prop_cap_bool(self):
+ tosca_tpl = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ "data/functions/test_get_prop_cap_bool.yaml")
+ some_node = self._get_node('software',
+ ToscaTemplate(tosca_tpl))
+ some_prop = some_node.get_properties()['some_prop']
+ self.assertIsInstance(some_prop.value, functions.GetProperty)
+ self.assertEqual(False, some_prop.value.result())
+
class GetAttributeTest(TestCase):
@@ -318,6 +338,10 @@ class GetAttributeTest(TestCase):
self.assertIsNotNone(self._load_template(
'functions/test_get_implicit_attribute.yaml'))
+ def test_get_attribute_capability_inheritance(self):
+ self.assertIsNotNone(self._load_template(
+ 'functions/test_container_cap_child.yaml'))
+
class ConcatTest(TestCase):