summaryrefslogtreecommitdiffstats
path: root/app/tests
diff options
context:
space:
mode:
authorManor, Yanir (ym903w) <ym903w@att.com>2018-10-21 11:33:28 +0300
committerManor, Yanir (ym903w) <ym903w@intl.att.com>2018-10-23 12:00:25 +0300
commitc81f7b519874fba8751c5db6a4c0b88fb5426335 (patch)
tree40ee01aebdbe4ff25c3ebb0557188211f46f8ed7 /app/tests
parentfaa922c2074d86e4fe9c1082e4c5a2191ff3b688 (diff)
Update code to latest
Change-Id: I3ceb652d415ff50a8f385f64745e5367f3ef3488 Issue-ID: SDC-1800 Signed-off-by: Manor, Yanir (ym903w) <ym903w@intl.att.com>
Diffstat (limited to 'app/tests')
-rw-r--r--app/tests/test_node_templates.py34
-rw-r--r--app/tests/test_value_templates.py23
2 files changed, 27 insertions, 30 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()
diff --git a/app/tests/test_value_templates.py b/app/tests/test_value_templates.py
index bc98fa8..7ebe95d 100644
--- a/app/tests/test_value_templates.py
+++ b/app/tests/test_value_templates.py
@@ -79,18 +79,17 @@ class TestValueMethods(unittest.TestCase):
res._update_function_reference(template)
self.assertEqual(res.value_from_item, template.inputs.get('inputName'))
- # TODO uncomment after merging latest ecomp code
- # def test_update_get_input_function_reference_auto_generate_input(self):
- # template = init_template()
- # node = template.node_dict.get('nodeName')
- # value = {'get_input': 'propertyName'}
- # res = _is_function(value)
- # self.assertIsNone(res.value_from_item)
- # self.assertIsNone(template.inputs.get('nodeName_propertyName'))
- # self.assertEqual(res.target_property, 'propertyName')
- # res._update_function_reference(template, node, node.properties.get('propertyName'))
- # self.assertIsNotNone(res.value_from_item)
- # self.assertEqual(res.value_from_item, template.inputs.get('nodeName_propertyName'))
+ def test_update_get_input_function_reference_auto_generate_input(self):
+ template = init_template()
+ node = template.node_dict.get('nodeName')
+ value = {'get_input': 'propertyName'}
+ res = _is_function(value)
+ self.assertIsNone(res.value_from_item)
+ self.assertIsNone(template.inputs.get('nodeName_propertyName'))
+ self.assertEqual(res.target_property, 'propertyName')
+ res._update_function_reference(template, node, node.properties.get('propertyName'))
+ self.assertIsNotNone(res.value_from_item)
+ self.assertEqual(res.value_from_item, template.inputs.get('nodeName_propertyName'))
def test_update_get_property_function_reference_node_not_found(self):
value = {'get_property': ['node_name', 'property_name']}