summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tests')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml3
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py5
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py9
3 files changed, 13 insertions, 4 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml
index b27e698..99d645b 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml
@@ -12,12 +12,15 @@ topology_template:
inputs:
mq_server_ip:
type: string
+ required: true
description: IP address of the message queuing server to receive messages from.
receiver_port:
type: string
+ required: true
description: Port to be used for receiving messages.
my_cpus:
type: integer
+ default: 2
description: Number of CPUs for the server.
constraints:
- valid_values: [ 1, 2, 4, 8 ]
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py b/tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py
index 0f1a33e..cbd4e3b 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py
+++ b/tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py
@@ -34,6 +34,11 @@ class TopologyTemplateTest(TestCase):
self.topo = TopologyTemplate(self.topo_tpl,
self._get_all_custom_def())
+ self.tosca_system_tpl_path = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ "data/topology_template/system.yaml")
+ self.system_template = ToscaTemplate(self.tosca_system_tpl_path)
+
def _get_custom_def(self, type_definition):
custom_defs = {}
for definition in self.imports:
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py b/tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py
index f0a87ac..104fab3 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py
+++ b/tosca2heat/tosca-parser/toscaparser/tests/test_toscadef.py
@@ -282,8 +282,9 @@ class ToscaDefTest(TestCase):
key=lambda x: str(x)))
def test_policies(self):
+ self.assertEqual(policy_root_type.parent_type, None)
self.assertEqual('tosca.policies.Root',
- policy_placement_type.parent_type)
+ policy_placement_type.parent_type.type)
self.assertEqual({}, policy_placement_type.parent_policies)
self.assertEqual(sorted(['tosca.policies.Root',
'The TOSCA Policy Type definition that is '
@@ -295,7 +296,7 @@ class ToscaDefTest(TestCase):
key=lambda x: str(x)))
self.assertEqual('tosca.policies.Root',
- policy_scaling_type.parent_type)
+ policy_scaling_type.parent_type.type)
self.assertEqual({}, policy_scaling_type.parent_policies)
self.assertEqual(sorted(['tosca.policies.Root',
'The TOSCA Policy Type definition that is '
@@ -307,7 +308,7 @@ class ToscaDefTest(TestCase):
key=lambda x: str(x)))
self.assertEqual('tosca.policies.Root',
- policy_update_type.parent_type)
+ policy_update_type.parent_type.type)
self.assertEqual({}, policy_update_type.parent_policies)
self.assertEqual(sorted(['tosca.policies.Root',
'The TOSCA Policy Type definition that is '
@@ -319,7 +320,7 @@ class ToscaDefTest(TestCase):
key=lambda x: str(x)))
self.assertEqual('tosca.policies.Root',
- policy_performance_type.parent_type)
+ policy_performance_type.parent_type.type)
self.assertEqual({}, policy_performance_type.parent_policies)
self.assertEqual(sorted(['tosca.policies.Root',
'The TOSCA Policy Type definition that is '