ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm...@apache.org
Subject [1/2] incubator-ariatosca git commit: review 1 - fixups 1
Date Thu, 03 Aug 2017 12:55:06 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-174-Refactor-instantiation-phase b729f6349 -> a33ba12e1


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a33ba12e/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py
----------------------------------------------------------------------
diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py b/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py
index d84f1c0..1f90d29 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py
@@ -498,6 +498,9 @@ def create_plugin_specification_model(context, policy):
 
 def create_workflow_operation_template_model(context, service_template, policy):
     model = OperationTemplate(name=policy._name)
+    # since we use backpopulates, these fields are populated upon commit, we get a weird(temporary)
+    # behavior where in previous code service_template.workflow_templates is a dict which
has None
+    # as key for the value of model.
     service_template.workflow_templates[model.name] = model
 
     if policy.description:
@@ -606,7 +609,7 @@ def create_parameter_model_from_value(template_parameter, template_parameter_nam
 def create_parameter_models_from_assignments(properties, source_properties, model_cls):
     if source_properties:
         for property_name, prop in source_properties.iteritems():
-            properties[property_name] = model_cls(name=property_name, # pylint: disable=unexpected-keyword-arg
+            properties[property_name] = model_cls(name=property_name,                   
           # pylint: disable=unexpected-keyword-arg
                                                   type_name=prop.value.type,
                                                   value=prop.value.value,
                                                   description=prop.value.description)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a33ba12e/tests/instantiation/test_configuration.py
----------------------------------------------------------------------
diff --git a/tests/instantiation/test_configuration.py b/tests/instantiation/test_configuration.py
index a41f0a8..6ac0c9c 100644
--- a/tests/instantiation/test_configuration.py
+++ b/tests/instantiation/test_configuration.py
@@ -165,11 +165,8 @@ def test_remote(service):
 
 
 def test_reserved_arguments(broken_service_issues):
-    assert len(broken_service_issues) == 2
-
-    assert any(
-        all([issue.message.startswith('using reserved arguments in operation "operation":
'),
-             'ctx' in issue.message,
-             'toolbelt' in issue.message])
-        for issue in broken_service_issues
-    )
+    assert len(broken_service_issues) == 1
+    message = broken_service_issues[0].message
+    assert message.startswith('using reserved arguments in operation "operation":')
+    assert '"ctx"' in message
+    assert '"toolbelt"' in message

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a33ba12e/tests/parser/test_reqs_caps.py
----------------------------------------------------------------------
diff --git a/tests/parser/test_reqs_caps.py b/tests/parser/test_reqs_caps.py
index 0af2487..e92aec4 100644
--- a/tests/parser/test_reqs_caps.py
+++ b/tests/parser/test_reqs_caps.py
@@ -18,10 +18,10 @@ from ..helpers import get_service_template_uri
 
 
 def test_satisfy_capability_type():
-    consume_reqs_caps_template('instance')
+    consume_reqs_caps_template1('instance')
 
 
-def consume_reqs_caps_template(consumer_class_name, cache=True):
+def consume_reqs_caps_template1(consumer_class_name, cache=True):
     consume_test_case(
         get_service_template_uri('tosca-simple-1.0', 'reqs_caps', 'reqs_caps1.yaml'),
         consumer_class_name=consumer_class_name,


Mime
View raw message