http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1f937296/aria/parser/presentation/fields.py
----------------------------------------------------------------------
diff --git a/aria/parser/presentation/fields.py 
b/aria/parser/presentation/fields.py
index 9de2f7b..5c08d4a 100644
--- a/aria/parser/presentation/fields.py
+++ b/aria/parser/presentation/fields.py
@@ -571,7 +571,7 @@ class Field(object):
     def _dump_primitive(self, context, value):
         if hasattr(value, 'as_raw'):
             value = as_raw(value)
-        puts('%s: %s' % (self.name, context.style.literal(value)))
+        puts('%s: %s' % (self.name, context.style.literal_style(value)))
 
     # primitive list
 
@@ -610,7 +610,7 @@ class Field(object):
             for primitive in value:
                 if hasattr(primitive, 'as_raw'):
                     primitive = as_raw(primitive)
-                puts(context.style.literal(primitive))
+                puts(context.style.literal_style(primitive))
 
     # primitive dict
 
@@ -639,7 +639,7 @@ class Field(object):
             for v in value.itervalues():
                 if hasattr(v, 'as_raw'):
                     v = as_raw(v)
-                puts(context.style.literal(v))
+                puts(context.style.literal_style(v))
 
     # object
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1f937296/aria/parser/presentation/presentation.py
----------------------------------------------------------------------
diff --git a/aria/parser/presentation/presentation.py 
b/aria/parser/presentation/presentation.py
index 164d9b2..3f9f86d 100644
--- a/aria/parser/presentation/presentation.py
+++ b/aria/parser/presentation/presentation.py
@@ -37,13 +37,13 @@ class Value(object):
 
     def _dump(self, context):
         if self.type is not None:
-            puts(context.style.type(self.type))
+            puts(context.style.type_style(self.type))
         if self.value is not None:
-            puts(context.style.literal(self.value))
+            puts(context.style.literal_style(self.value))
         if self.description is not None:
-            puts(context.style.meta(self.description))
+            puts(context.style.meta_style(self.description))
         if self.required is not None:
-            puts(context.style.required(self.required))
+            puts(context.style.required_style(self.required))
 
 
 class PresentationBase(HasCachedMethods):
@@ -162,7 +162,7 @@ class PresentationBase(HasCachedMethods):
             for field_name in self._iter_field_names():  # pylint: 
disable=no-member
                 self._dump_field(context, field_name)
         else:
-            puts(context.style.literal(self._raw))
+            puts(context.style.literal_style(self._raw))
 
     def _dump_field(self, context, field_name):
         """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1f937296/aria/parser/validation/context.py
----------------------------------------------------------------------
diff --git a/aria/parser/validation/context.py 
b/aria/parser/validation/context.py
index a245518..da9eef6 100644
--- a/aria/parser/validation/context.py
+++ b/aria/parser/validation/context.py
@@ -16,7 +16,7 @@
 from . import issue
 
 
-class ValidationContext(issue.Reporter):
+class ValidationContext(issue.ReporterMixin):
     """
     Validation context.
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1f937296/aria/parser/validation/issue.py
----------------------------------------------------------------------
diff --git a/aria/parser/validation/issue.py b/aria/parser/validation/issue.py
index 11ea7f9..42fc580 100644
--- a/aria/parser/validation/issue.py
+++ b/aria/parser/validation/issue.py
@@ -132,12 +132,12 @@ class Issue(object):
         return heading_str
 
 
-class Reporter(object):
+class ReporterMixin(object):
 
     Issue = Issue
 
     def __init__(self, *args, **kwargs):
-        super(Reporter, self).__init__(*args, **kwargs)
+        super(ReporterMixin, self).__init__(*args, **kwargs)
         self._issues = threading.LockedList()
         self.max_level = self.Issue.ALL
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1f937296/aria/utils/console.py
----------------------------------------------------------------------
diff --git a/aria/utils/console.py b/aria/utils/console.py
index cd5d480..0d379e1 100644
--- a/aria/utils/console.py
+++ b/aria/utils/console.py
@@ -31,51 +31,51 @@ _indent_string = ''
 
 
 class TopologyStylizer(object):
-    def __init__(self, indentation=2):
+    def __init__(self, indentation=0):
         self._str = StringIO()
         self._indentation = indentation
 
-    def write(self, str_):
-        puts(str_, stream=self._str)
+    def write(self, string):
+        self._str.write(' ' * self._indentation)
+        self._str.write(string)
+        self._str.write(os.linesep)
 
     @contextmanager
-    def indent(self, indentation=None):
-        with indent(indentation or self._indentation):
-            yield
+    def indent(self, indentation=2):
+        self._indentation += indentation
+        yield
+        self._indentation -= indentation
 
     @staticmethod
-    def section(value):
+    def section_style(value):
         return Colored.cyan(value, bold=True)
 
     @staticmethod
-    def type(value):
+    def type_style(value):
         return Colored.blue(value, bold=True)
 
     @staticmethod
-    def node(value):
+    def node_style(value):
         return Colored.red(value, bold=True)
 
     @staticmethod
-    def property(value):
+    def property_style(value):
         return Colored.magenta(value, bold=True)
 
     @staticmethod
-    def literal(value):
+    def literal_style(value):
         return Colored.magenta(formatting.safe_repr(value))
 
     @staticmethod
-    def required(value):
+    def required_style(value):
         return Colored.white(value)
 
     @staticmethod
-    def meta(value):
+    def meta_style(value):
         return Colored.green(value)
 
-    def __repr__(self):
-        return self._str.getvalue()
-
     def __str__(self):
-        return repr(self)
+        return self._str.getvalue()
 
 
 def puts(string='', newline=True, stream=sys.stdout):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1f937296/extensions/aria_extension_tosca/simple_v1_0/misc.py
----------------------------------------------------------------------
diff --git a/extensions/aria_extension_tosca/simple_v1_0/misc.py 
b/extensions/aria_extension_tosca/simple_v1_0/misc.py
index 23beb3c..a65ff41 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/misc.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/misc.py
@@ -52,7 +52,7 @@ class Description(AsIsPresentation):
 
     def _dump(self, context):
         value = as_raw(self.value)
-        puts(context.style.meta(value))
+        puts(context.style.meta_style(value))
 
 
 @allow_unknown_fields

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1f937296/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/1f937296/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/1f937296/tests/parser/service_templates.py
----------------------------------------------------------------------
diff --git a/tests/parser/service_templates.py 
b/tests/parser/service_templates.py
index ec41cd2..9e8fcae 100644
--- a/tests/parser/service_templates.py
+++ b/tests/parser/service_templates.py
@@ -27,7 +27,6 @@ def consume_literal(literal, consumer_class_name='instance', 
cache=True, no_issu
     context = create_context(LiteralLocation(literal))
     consumer, dumper = create_consumer(context, consumer_class_name)
     consumer.consume()
-    consumer.dump()
     if no_issues:
         context.validation.dump_issues()
         assert not context.validation.has_issues
@@ -48,6 +47,7 @@ def consume_use_case(use_case_name, 
consumer_class_name='instance', cache=True):
     assert not context.validation.has_issues
     return context, dumper
 
+
 def consume_types_use_case(use_case_name, consumer_class_name='instance', 
cache=True):
     cachedmethod.ENABLED = cache
     uri = get_service_template_uri('tosca-simple-1.0', 'types', use_case_name,
@@ -62,6 +62,7 @@ def consume_types_use_case(use_case_name, 
consumer_class_name='instance', cache=
     assert not context.validation.has_issues
     return context, dumper
 
+
 def consume_node_cellar(consumer_class_name='instance', cache=True):
     consume_test_case(
         get_service_template_uri('tosca-simple-1.0', 'node-cellar', 
'node-cellar.yaml'),

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1f937296/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,

Reply via email to