From 32a4ee56e1dfbe986aab75bc7924057790c189cf Mon Sep 17 00:00:00 2001 From: shangxdy Date: Tue, 14 Jun 2016 23:37:36 +0800 Subject: The artifacttype's parent_type definition is error 1. Artifact type define parent_type, but it shall be statuefulentity, not string, so the method of is_derived_from in artifact entity may be error when it's called. 2. The bug will submit to openstack community. Change-Id: I8e64a28da0287ff5653da69a0cf15016c8ed937f JIRA: PARSER-53 Signed-off-by: shangxdy --- tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tosca2heat/tosca-parser/toscaparser/tests') diff --git a/tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py b/tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py index f0a87ac..7783b0c 100644 --- a/tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py +++ b/tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py @@ -188,8 +188,9 @@ class ToscaDefTest(TestCase): self.assertIn(ifaces.LIFECYCLE_SHORTNAME, root_node.interfaces) def test_artifacts(self): + self.assertEqual(artif_root_type.parent_type, None) self.assertEqual('tosca.artifacts.Root', - artif_file_type.parent_type) + artif_file_type.parent_type.type) self.assertEqual({}, artif_file_type.parent_artifacts) self.assertEqual(sorted(['tosca.artifacts.Root'], key=lambda x: str(x)), @@ -198,7 +199,7 @@ class ToscaDefTest(TestCase): key=lambda x: str(x))) self.assertEqual('tosca.artifacts.Implementation', - artif_bash_type.parent_type) + artif_bash_type.parent_type.type) self.assertEqual({'tosca.artifacts.Implementation': {'derived_from': 'tosca.artifacts.Root', 'description': @@ -212,7 +213,7 @@ class ToscaDefTest(TestCase): key=lambda x: str(x))) self.assertEqual('tosca.artifacts.Implementation', - artif_python_type.parent_type) + artif_python_type.parent_type.type) self.assertEqual({'tosca.artifacts.Implementation': {'derived_from': 'tosca.artifacts.Root', 'description': @@ -227,7 +228,7 @@ class ToscaDefTest(TestCase): key=lambda x: str(x))) self.assertEqual('tosca.artifacts.Deployment.Image', - artif_container_docker_type.parent_type) + artif_container_docker_type.parent_type.type) self.assertEqual({'tosca.artifacts.Deployment': {'derived_from': 'tosca.artifacts.Root', 'description': @@ -244,7 +245,7 @@ class ToscaDefTest(TestCase): key=lambda x: str(x))) self.assertEqual('tosca.artifacts.Deployment.Image', - artif_vm_iso_type.parent_type) + artif_vm_iso_type.parent_type.type) self.assertEqual({'tosca.artifacts.Deployment': {'derived_from': 'tosca.artifacts.Root', 'description': @@ -263,7 +264,7 @@ class ToscaDefTest(TestCase): key=lambda x: str(x))) self.assertEqual('tosca.artifacts.Deployment.Image', - artif_vm_qcow2_type.parent_type) + artif_vm_qcow2_type.parent_type.type) self.assertEqual({'tosca.artifacts.Deployment': {'derived_from': 'tosca.artifacts.Root', 'description': -- cgit 1.2.3-korg