diff options
Diffstat (limited to 'app/tests/test_node_templates.py')
-rw-r--r-- | app/tests/test_node_templates.py | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/app/tests/test_node_templates.py b/app/tests/test_node_templates.py index 15d5480..2d79b95 100644 --- a/app/tests/test_node_templates.py +++ b/app/tests/test_node_templates.py @@ -20,25 +20,23 @@ class TestNodeTemplateMethods(unittest.TestCase): node._parse_pre_defined_content(prop_sec) self.assertEqual('template_value', node.properties.get('propertyName').value.value) - # TODO uncomment after merging ecomp latest code - # def test_update_get_node_name_property_value(self): - # template = init_template() - # node = Node(template, 'myNode', template.db.NODE_TYPES.get('nodeTypeName')) - # prop_sec = {'properties': {'propertyName': '__GET_NODE_NAME__'}} - # node._parse_pre_defined_content(prop_sec) - # self.assertEqual('__GET_NODE_NAME__', node.properties.get('propertyName').value.value) - # node._update_get_node_name() - # self.assertEqual('myNode', node.properties.get('propertyName').value.value) + def test_update_get_node_name_property_value(self): + template = init_template() + node = Node(template, 'myNode', template.db.NODE_TYPES.get('nodeTypeName')) + prop_sec = {'properties': {'propertyName': '__GET_NODE_NAME__'}} + node._parse_pre_defined_content(prop_sec) + self.assertEqual('__GET_NODE_NAME__', node.properties.get('propertyName').value.value) + node._update_get_node_name() + self.assertEqual('myNode', node.properties.get('propertyName').value.value) - # TODO uncomment after merging ecomp latest code - # def test_update_get_node_name_capability_property_value(self): - # template = init_template() - # node = Node(template, 'myNode', template.db.NODE_TYPES.get('nodeTypeName')) - # prop_sec = {'capabilities': {'capabilityName': {'properties': {'capabilityProperty': '__GET_NODE_NAME__'}}}} - # node._parse_pre_defined_content(prop_sec) - # self.assertEqual('__GET_NODE_NAME__', node._get_capability_property('capabilityName', 'capabilityProperty').value.value) - # node._update_get_node_name() - # self.assertEqual('myNode', node._get_capability_property('capabilityName', 'capabilityProperty').value.value) + def test_update_get_node_name_capability_property_value(self): + template = init_template() + node = Node(template, 'myNode', template.db.NODE_TYPES.get('nodeTypeName')) + prop_sec = {'capabilities': {'capabilityName': {'properties': {'capabilityProperty': '__GET_NODE_NAME__'}}}} + node._parse_pre_defined_content(prop_sec) + self.assertEqual('__GET_NODE_NAME__', node._get_capability_property('capabilityName', 'capabilityProperty').value.value) + node._update_get_node_name() + self.assertEqual('myNode', node._get_capability_property('capabilityName', 'capabilityProperty').value.value) def test_update_prefix(self): template = init_template() |