ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From emblempar...@apache.org
Subject [5/5] incubator-ariatosca git commit: PR fixes
Date Wed, 05 Jul 2017 20:46:47 GMT
PR fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/2be2e526
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/2be2e526
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/2be2e526

Branch: refs/heads/ARIA-260-send-interface-inputs
Commit: 2be2e526f032397cc267432135e6f18327d458c6
Parents: 9039942
Author: Tal Liron <tal.liron@gmail.com>
Authored: Wed Jul 5 15:46:21 2017 -0500
Committer: Tal Liron <tal.liron@gmail.com>
Committed: Wed Jul 5 15:46:21 2017 -0500

----------------------------------------------------------------------
 aria/modeling/utils.py                    |  4 ++++
 tests/instantiation/test_configuration.py | 17 +++++++----------
 2 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2be2e526/aria/modeling/utils.py
----------------------------------------------------------------------
diff --git a/aria/modeling/utils.py b/aria/modeling/utils.py
index 64e7c74..e0fd11b 100644
--- a/aria/modeling/utils.py
+++ b/aria/modeling/utils.py
@@ -211,6 +211,10 @@ def dump_interfaces(interfaces, name='Interfaces'):
             interface.dump()
 
 
+def parameters_as_values(the_dict):
+    return dict((k, v.value) for k, v in the_dict.iteritems())
+
+
 def dict_as_arguments(the_dict):
     return OrderedDict((name, value.as_argument()) for name, value in the_dict.iteritems())
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2be2e526/tests/instantiation/test_configuration.py
----------------------------------------------------------------------
diff --git a/tests/instantiation/test_configuration.py b/tests/instantiation/test_configuration.py
index 7629539..6ac0c9c 100644
--- a/tests/instantiation/test_configuration.py
+++ b/tests/instantiation/test_configuration.py
@@ -16,6 +16,7 @@
 import pytest
 
 from tests.parser.service_templates import consume_literal
+from aria.modeling.utils import parameters_as_values
 
 
 TEMPLATE = """
@@ -116,23 +117,19 @@ def broken_service_issues():
     yield context.validation.issues
 
 
-def _values(the_dict):
-    return dict((k, v.value) for k, v in the_dict.iteritems())
-
-
 def test_local(service):
     interface = service.nodes['local_node_1'].interfaces['MyInterface']
     operation = interface.operations['operation']
-    assert _values(interface.inputs) == {
+    assert parameters_as_values(interface.inputs) == {
         'interface_string': 'value1',
         'interface_integer': 1
     }
-    assert _values(operation.inputs) == {
+    assert parameters_as_values(operation.inputs) == {
         'operation_string': 'value2',
         'operation_integer': 2,
         'interface_integer': 3
     }
-    assert _values(operation.arguments) == {
+    assert parameters_as_values(operation.arguments) == {
         'process': {},
         'script_path': 'operation.sh',
         'interface_string': 'value1',
@@ -145,16 +142,16 @@ def test_local(service):
 def test_remote(service):
     interface = service.nodes['remote_node_1'].interfaces['MyInterface']
     operation = interface.operations['operation']
-    assert _values(interface.inputs) == {
+    assert parameters_as_values(interface.inputs) == {
         'interface_string': 'value1',
         'interface_integer': 1
     }
-    assert _values(operation.inputs) == {
+    assert parameters_as_values(operation.inputs) == {
         'operation_string': 'value2',
         'operation_integer': 2,
         'interface_integer': 3
     }
-    assert _values(operation.arguments) == {
+    assert parameters_as_values(operation.arguments) == {
         'process': {},
         'use_sudo': False,
         'fabric_env': {'user': '', 'password': '', 'key': None, 'key_filename': None},


Mime
View raw message