Add more test for nested import list 61/37361/1
authorshangxdy <shang.xiaodong@zte.com.cn>
Thu, 13 Jul 2017 11:01:08 +0000 (19:01 +0800)
committershangxdy <shang.xiaodong@zte.com.cn>
Thu, 13 Jul 2017 11:01:08 +0000 (19:01 +0800)
Currently the test about nested import list is not enough, the patch
enhance the test.

Change-Id: Ica25345062d316b9a32f4efb8c5c2a98b8bda497
JIRA: PARSER-127
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
tosca2heat/tosca-parser/toscaparser/tests/data/custom_types/nested_test_kibana.yaml [new file with mode: 0644]
tosca2heat/tosca-parser/toscaparser/tests/data/test_instance_nested_imports.yaml
tosca2heat/tosca-parser/toscaparser/tests/test_toscatpl.py

diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/custom_types/nested_test_kibana.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/custom_types/nested_test_kibana.yaml
new file mode 100644 (file)
index 0000000..c8675c6
--- /dev/null
@@ -0,0 +1,3 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+imports:
+  - custom_types/kibana.yaml
index 6aa9307..a130e49 100644 (file)
@@ -5,6 +5,7 @@ description: >
 
 imports:
   - wordpress: custom_types/nested_test_wordpress.yaml
+  - custom_types/nested_test_kibana.yaml
 
 topology_template:
 
@@ -20,3 +21,6 @@ topology_template:
 
     logstash:
       type: tosca.nodes.SoftwareComponent.Logstash
+
+    kibana:
+      type: tosca.nodes.SoftwareComponent.Kibana
index 77232df..c89f867 100644 (file)
@@ -510,7 +510,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',