summaryrefslogtreecommitdiffstats
path: root/nfvparser/toscaparser/tests/test_toscatpl.py
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2017-09-26 20:40:39 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2017-09-26 20:47:53 +0800
commit000ea52b78b072435f01d67dd799023117e67a2e (patch)
tree1f14cdb4485e2184904b553b82afd9e7139a18e5 /nfvparser/toscaparser/tests/test_toscatpl.py
parent53065490134870ead778bff590cfd9e43ddd9f77 (diff)
Sync code from nfv-toscaprser
Currently nfv-toscaparser has published the regular version of 0.5.1 the patch will synchronize the code. JIRA: MODELING-23 Change-Id: If95579fc366b69b2b14b2e441ff9a3e6807e3820 Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'nfvparser/toscaparser/tests/test_toscatpl.py')
-rw-r--r--nfvparser/toscaparser/tests/test_toscatpl.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/nfvparser/toscaparser/tests/test_toscatpl.py b/nfvparser/toscaparser/tests/test_toscatpl.py
index fac8687..fd8ee90 100644
--- a/nfvparser/toscaparser/tests/test_toscatpl.py
+++ b/nfvparser/toscaparser/tests/test_toscatpl.py
@@ -216,6 +216,10 @@ class ToscaTemplateTest(TestCase):
tosca_tpl = self._load_template('test_no_outputs_in_template.yaml')
self.assertEqual(0, len(tosca_tpl.outputs))
+ def test_template_file_with_suffix_yml(self):
+ tosca_tpl = self._load_template('custom_types/wordpress.yml')
+ self.assertIsNotNone(tosca_tpl)
+
def test_relationship_interface(self):
template = ToscaTemplate(self.tosca_elk_tpl)
for node_tpl in template.nodetemplates:
@@ -510,7 +514,8 @@ class ToscaTemplateTest(TestCase):
os.path.dirname(os.path.abspath(__file__)),
"data/test_instance_nested_imports.yaml")
tosca = ToscaTemplate(tosca_tpl)
- expected_custom_types = ['tosca.nodes.WebApplication.WordPress',
+ expected_custom_types = ['tosca.nodes.SoftwareComponent.Kibana',
+ 'tosca.nodes.WebApplication.WordPress',
'test_namespace_prefix.Rsyslog',
'Test2ndRsyslogType',
'test_2nd_namespace_prefix.Rsyslog',
@@ -661,6 +666,17 @@ class ToscaTemplateTest(TestCase):
self.assertEqual(tosca.version, "tosca_simple_yaml_1_0")
+ def test_yaml_dict_tpl_with_version_1_1(self):
+ test_tpl = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ "data/tosca_helloworld_with_version_1_1.yaml")
+
+ yaml_dict_tpl = toscaparser.utils.yamlparser.load_yaml(test_tpl)
+
+ tosca = ToscaTemplate(yaml_dict_tpl=yaml_dict_tpl)
+
+ self.assertEqual(tosca.version, "tosca_simple_yaml_1_1")
+
def test_yaml_dict_tpl_with_params_and_url_import(self):
test_tpl = os.path.join(
os.path.dirname(os.path.abspath(__file__)),