ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From emblempar...@apache.org
Subject [1/2] incubator-ariatosca git commit: Allow skipping of normative type validation [Forced Update!]
Date Tue, 26 Sep 2017 23:44:12 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-1-parser-test-suite 63b218510 -> 9fe6e7cdd (forced update)


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_artifacts.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_artifacts.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_artifacts.py
new file mode 100644
index 0000000..0c28d5a
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_artifacts.py
@@ -0,0 +1,77 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from ... import data
+
+
+# Artifacts section
+
+@pytest.mark.parametrize('value', data.NOT_A_DICT)
+def test_node_type_artifacts_section_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    artifacts: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_artifacts_section_syntax_empty(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    artifacts: {}
+""").assert_success()
+
+
+# Artifact
+
+@pytest.mark.parametrize('value', data.NOT_A_DICT)
+def test_node_type_artifact_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    artifacts:
+      my_artifact: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_artifact_syntax_unsupported(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+artifact_types:
+  MyType: {}
+node_types:
+  MyType:
+    artifacts:
+      my_artifact:
+        type: MyType
+        unsupported: {}
+""").assert_failure()
+
+
+def test_node_type_artifact_syntax_empty(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    artifacts:
+      my_artifact: {} # "type" is required
+""").assert_failure()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_capabilities.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_capabilities.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_capabilities.py
new file mode 100644
index 0000000..1a60b54
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_capabilities.py
@@ -0,0 +1,306 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from ... import data
+
+
+PARAMETER_SECTION_NAMES = ('properties', 'attributes')
+
+
+# Capabilities section
+
+@pytest.mark.parametrize('value', data.NOT_A_DICT)
+def test_node_type_capabilities_section_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    capabilities: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_capabilities_section_syntax_empty(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    capabilities: {}
+""").assert_success()
+
+
+# Capability
+
+@pytest.mark.parametrize('value', data.NOT_A_DICT)
+def test_node_type_capability_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    capabilities:
+      my_capability: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_capability_syntax_unsupported(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        unsupported: {}
+""").assert_failure()
+
+
+def test_node_type_capability_syntax_empty(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    capabilities:
+      my_capability: {} # "type" is required
+""").assert_failure()
+
+
+# Description
+
+@pytest.mark.parametrize('value', data.NOT_A_STRING)
+def test_node_type_capability_description_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        description: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_capability_description(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        description: a description
+""").assert_success()
+
+
+# Type
+
+@pytest.mark.parametrize('value', data.NOT_A_STRING)
+def test_node_type_capability_type_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_capability_type_unknown(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: UnknownType
+""").assert_failure()
+
+
+def test_node_type_capability_type_override(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType1: {}
+  MyType2:
+    derived_from: MyType1
+node_types:
+  MyType1:
+    capabilities:
+      my_capability:
+        type: MyType1
+  MyType2:
+    derived_from: MyType1
+    capabilities:
+      my_capability:
+        type: MyType2
+""").assert_success()
+
+
+def test_node_type_capability_type_override_bad(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType1: {}
+  MyType2:
+    derived_from: MyType1
+node_types:
+  MyType1:
+    capabilities:
+      my_capability:
+        type: MyType2
+  MyType2:
+    derived_from: MyType1
+    capabilities:
+      my_capability:
+        type: MyType1
+""").assert_failure()
+
+
+# Valid source types
+
+@pytest.mark.parametrize('value', data.NOT_A_LIST)
+def test_node_type_capability_valid_source_types_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        valid_source_types: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('value', data.NOT_A_STRING)
+def test_node_type_capability_valid_source_types_syntax_element_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        valid_source_types: [ {{ value }} ]
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_capability_valid_source_types_syntax_empty(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        valid_source_types: []
+""").assert_success()
+
+
+
+def test_node_type_capability_valid_source_types(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType1:
+    capabilities:
+      my_capability:
+        type: MyType
+        valid_source_types: [ MyType1, MyType2 ]
+  MyType2: {}
+""").assert_success()
+
+
+def test_node_type_capability_valid_source_types_unknown(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        valid_source_types: [ UnknownType ]
+""").assert_failure()
+
+
+# Occurrences
+
+@pytest.mark.parametrize('value', data.OCCURRENCES)
+def test_node_type_capability_occurrences(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        occurrences: {{ value }}
+""", dict(value=value)).assert_success()
+
+
+@pytest.mark.parametrize('value', data.BAD_OCCURRENCES)
+def test_node_type_capability_occurrences_bad(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    capabilities:
+      my_capability:
+        type: MyType
+        occurrences: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+# Unicode
+
+def test_node_type_capability_unicode(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  類型: {}
+node_types:
+  類型:
+    capabilities:
+      能力:
+        type: 類型
+        properties:
+          參數:
+            type: string
+            description: 描述
+            default: 值
+            status: supported
+        valid_source_types: [ 類型 ]
+""").assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_relationship_interfaces.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_relationship_interfaces.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_relationship_interfaces.py
new file mode 100644
index 0000000..ee34a3a
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_relationship_interfaces.py
@@ -0,0 +1,92 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+These tests are in addition to those in common/test_type_interface.py.
+"""
+
+import pytest
+
+
+# Type
+
+def test_node_type_relationship_interface_type_override(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+relationship_types:
+  MyType: {}
+interface_types:
+  MyType1: {}
+  MyType2:
+    derived_from: MyType1
+node_types:
+  MyType1:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            type: MyType
+            interfaces:
+              my_interface:
+                type: MyType1
+  MyType2:
+    derived_from: MyType1
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            type: MyType
+            interfaces:
+              my_interface:
+                type: MyType2
+""").assert_success()
+
+
+@pytest.mark.skip(reason='fix')
+def test_node_type_relationship_interface_type_override_bad(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+relationship_types:
+  MyType: {}
+interface_types:
+  MyType1: {}
+  MyType2:
+    derived_from: MyType1
+node_types:
+  MyType1:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            type: MyType
+            interfaces:
+              my_interface:
+                type: MyType2
+  MyType2:
+    derived_from: MyType1
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            type: MyType
+            interfaces:
+              my_interface:
+                type: MyType1
+""").assert_failure()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_requirements.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_requirements.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_requirements.py
new file mode 100644
index 0000000..710bd22
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_requirements.py
@@ -0,0 +1,361 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from ... import data
+
+
+# Requirements section
+
+@pytest.mark.parametrize('value', data.NOT_A_LIST)
+def test_node_type_requirements_section_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    requirements: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_requirements_section_syntax_empty(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    requirements: []
+""").assert_success()
+
+
+# Requirement
+
+@pytest.mark.parametrize('value', data.NOT_A_DICT)
+def test_node_type_requirement_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    requirements:
+      - my_requirement: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_requirement_syntax_unsupported(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          unsupported: {}
+""").assert_failure()
+
+
+def test_node_type_requirement_syntax_empty(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    requirements:
+      - my_requirement: {} # "capability" is required
+""").assert_failure()
+
+
+# Capability
+
+@pytest.mark.parametrize('value', data.NOT_A_DICT_OR_STRING)
+def test_node_type_requirement_capability_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_requirement_capability_syntax_unsupported(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability:
+            unsupported: {}
+""").assert_failure()
+
+
+def test_node_type_requirement_capability_short_form(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement: MyType
+""").assert_success()
+
+
+# Capability type
+
+def test_node_type_requirement_capability_type_unknown(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: UnknownType
+""").assert_failure()
+
+
+def test_node_type_requirement_capability_type_override(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType1: {}
+  MyType2: {}
+node_types:
+  MyType1:
+    requirements:
+      - my_requirement:
+          capability: MyType1
+  MyType2:
+    derived_from: MyType1
+    requirements:
+      - my_requirement:
+          capability: MyType2 # you are allowed to change the capability type to anything
+""").assert_success()
+
+
+# Node
+
+@pytest.mark.parametrize('value', data.NOT_A_STRING)
+def test_node_type_requirement_node_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          node: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_requirement_node_unknown(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          node: UnknownType
+""").assert_failure()
+
+
+def test_node_type_requirement_node_override(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType1:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          node: MyType3
+  MyType2:
+    derived_from: MyType1
+    requirements:
+      - my_requirement:
+          capability: MyType
+          node: MyType4 # you are allowed to change the node type to anything
+  MyType3: {}
+  MyType4: {}
+""").assert_success()
+
+
+# Relationship
+
+@pytest.mark.parametrize('value', data.NOT_A_DICT_OR_STRING)
+def test_node_type_requirement_relationship_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_requirement_relationship_syntax_unsupported(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            unsupported: {}
+""").assert_failure()
+
+
+def test_node_type_requirement_relationship_short_form(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+relationship_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship: MyType
+""").assert_success()
+
+
+# Relationship type
+
+@pytest.mark.parametrize('value', data.NOT_A_DICT_OR_STRING)
+def test_node_type_requirement_relationship_type_syntax_type(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            type: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+def test_node_type_requirement_relationship_type_unknown(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            type: UnknownType
+""").assert_failure()
+
+
+def test_node_type_requirement_relationship_type_override(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+relationship_types:
+  MyType1: {}
+  MyType2: {}
+node_types:
+  MyType1:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            type: MyType1
+  MyType2:
+    derived_from: MyType1
+    requirements:
+      - my_requirement:
+          capability: MyType
+          relationship:
+            type: MyType2 # you are allowed to change the relationship type to anything
+""").assert_success()
+
+
+# Occurrences
+
+@pytest.mark.parametrize('value', data.OCCURRENCES)
+def test_node_type_requirement_occurrences(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          occurrences: {{ value }}
+""", dict(value=value)).assert_success()
+
+
+@pytest.mark.parametrize('value', data.BAD_OCCURRENCES)
+def test_node_type_requirement_occurrences_bad(parser, value):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  MyType: {}
+node_types:
+  MyType:
+    requirements:
+      - my_requirement:
+          capability: MyType
+          occurrences: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+# Unicode
+
+def test_node_type_requirement_unicode(parser):
+    parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+capability_types:
+  類型: {}
+relationship_types:
+  類型: {}
+node_types:
+  類型:
+    requirements:
+      - 需求:
+          capability: 類型
+          node: 類型
+          relationship:
+            type: 類型
+          occurrences: [ 0, UNBOUNDED ]
+""").assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/__init__.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/__init__.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/__init__.py
deleted file mode 100644
index ae1e83e..0000000
--- a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_artifacts.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_artifacts.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_artifacts.py
deleted file mode 100644
index 0c28d5a..0000000
--- a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_artifacts.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# -*- coding: utf-8 -*-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import pytest
-
-from ... import data
-
-
-# Artifacts section
-
-@pytest.mark.parametrize('value', data.NOT_A_DICT)
-def test_node_type_artifacts_section_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    artifacts: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_artifacts_section_syntax_empty(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    artifacts: {}
-""").assert_success()
-
-
-# Artifact
-
-@pytest.mark.parametrize('value', data.NOT_A_DICT)
-def test_node_type_artifact_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    artifacts:
-      my_artifact: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_artifact_syntax_unsupported(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-artifact_types:
-  MyType: {}
-node_types:
-  MyType:
-    artifacts:
-      my_artifact:
-        type: MyType
-        unsupported: {}
-""").assert_failure()
-
-
-def test_node_type_artifact_syntax_empty(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    artifacts:
-      my_artifact: {} # "type" is required
-""").assert_failure()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_capabilities.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_capabilities.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_capabilities.py
deleted file mode 100644
index 1edc2cb..0000000
--- a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_capabilities.py
+++ /dev/null
@@ -1,303 +0,0 @@
-# -*- coding: utf-8 -*-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import pytest
-
-from ... import data
-
-
-# Capabilities section
-
-@pytest.mark.parametrize('value', data.NOT_A_DICT)
-def test_node_type_capabilities_section_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    capabilities: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_capabilities_section_syntax_empty(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    capabilities: {}
-""").assert_success()
-
-
-# Capability
-
-@pytest.mark.parametrize('value', data.NOT_A_DICT)
-def test_node_type_capability_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    capabilities:
-      my_capability: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_capability_syntax_unsupported(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        unsupported: {}
-""").assert_failure()
-
-
-def test_node_type_capability_syntax_empty(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    capabilities:
-      my_capability: {} # "type" is required
-""").assert_failure()
-
-
-# Description
-
-@pytest.mark.parametrize('value', data.NOT_A_STRING)
-def test_node_type_capability_description_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        description: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_capability_description(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        description: a description
-""").assert_success()
-
-
-# Type
-
-@pytest.mark.parametrize('value', data.NOT_A_STRING)
-def test_node_type_capability_type_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_capability_type_unknown(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: UnknownType
-""").assert_failure()
-
-
-def test_node_type_capability_type_override(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType1: {}
-  MyType2:
-    derived_from: MyType1
-node_types:
-  MyType1:
-    capabilities:
-      my_capability:
-        type: MyType1
-  MyType2:
-    derived_from: MyType1
-    capabilities:
-      my_capability:
-        type: MyType2
-""").assert_success()
-
-
-def test_node_type_capability_type_override_bad(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType1: {}
-  MyType2:
-    derived_from: MyType1
-node_types:
-  MyType1:
-    capabilities:
-      my_capability:
-        type: MyType2
-  MyType2:
-    derived_from: MyType1
-    capabilities:
-      my_capability:
-        type: MyType1
-""").assert_failure()
-
-
-# Valid source types
-
-@pytest.mark.parametrize('value', data.NOT_A_LIST)
-def test_node_type_capability_valid_source_types_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        valid_source_types: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-@pytest.mark.parametrize('value', data.NOT_A_STRING)
-def test_node_type_capability_valid_source_types_syntax_element_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        valid_source_types: [ {{ value }} ]
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_capability_valid_source_types_syntax_empty(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        valid_source_types: []
-""").assert_success()
-
-
-
-def test_node_type_capability_valid_source_types(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType1:
-    capabilities:
-      my_capability:
-        type: MyType
-        valid_source_types: [ MyType1, MyType2 ]
-  MyType2: {}
-""").assert_success()
-
-
-def test_node_type_capability_valid_source_types_unknown(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        valid_source_types: [ UnknownType ]
-""").assert_failure()
-
-
-# Occurrences
-
-@pytest.mark.parametrize('value', data.OCCURRENCES)
-def test_node_type_capability_occurrences(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        occurrences: {{ value }}
-""", dict(value=value)).assert_success()
-
-
-@pytest.mark.parametrize('value', data.BAD_OCCURRENCES)
-def test_node_type_capability_occurrences_bad(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    capabilities:
-      my_capability:
-        type: MyType
-        occurrences: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-# Unicode
-
-@pytest.mark.parametrize('parameter_section', data.PARAMETER_SECTION_NAMES)
-def test_node_type_capability_unicode(parser, parameter_section):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  類型: {}
-node_types:
-  類型:
-    capabilities:
-      能力:
-        type: 類型
-        {{ parameter_section }}:
-          參數:
-            type: string
-            description: 描述
-            default: 值
-            status: supported
-""", dict(parameter_section=parameter_section)).assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_relationship_interfaces.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_relationship_interfaces.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_relationship_interfaces.py
deleted file mode 100644
index ee34a3a..0000000
--- a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_relationship_interfaces.py
+++ /dev/null
@@ -1,92 +0,0 @@
-# -*- coding: utf-8 -*-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""
-These tests are in addition to those in common/test_type_interface.py.
-"""
-
-import pytest
-
-
-# Type
-
-def test_node_type_relationship_interface_type_override(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-relationship_types:
-  MyType: {}
-interface_types:
-  MyType1: {}
-  MyType2:
-    derived_from: MyType1
-node_types:
-  MyType1:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            type: MyType
-            interfaces:
-              my_interface:
-                type: MyType1
-  MyType2:
-    derived_from: MyType1
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            type: MyType
-            interfaces:
-              my_interface:
-                type: MyType2
-""").assert_success()
-
-
-@pytest.mark.skip(reason='fix')
-def test_node_type_relationship_interface_type_override_bad(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-relationship_types:
-  MyType: {}
-interface_types:
-  MyType1: {}
-  MyType2:
-    derived_from: MyType1
-node_types:
-  MyType1:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            type: MyType
-            interfaces:
-              my_interface:
-                type: MyType2
-  MyType2:
-    derived_from: MyType1
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            type: MyType
-            interfaces:
-              my_interface:
-                type: MyType1
-""").assert_failure()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_requirements.py
----------------------------------------------------------------------
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_requirements.py b/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_requirements.py
deleted file mode 100644
index 710bd22..0000000
--- a/tests/extensions/aria_extension_tosca/simple_v1_0/types/node_types/test_node_type_requirements.py
+++ /dev/null
@@ -1,361 +0,0 @@
-# -*- coding: utf-8 -*-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import pytest
-
-from ... import data
-
-
-# Requirements section
-
-@pytest.mark.parametrize('value', data.NOT_A_LIST)
-def test_node_type_requirements_section_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    requirements: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_requirements_section_syntax_empty(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    requirements: []
-""").assert_success()
-
-
-# Requirement
-
-@pytest.mark.parametrize('value', data.NOT_A_DICT)
-def test_node_type_requirement_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    requirements:
-      - my_requirement: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_requirement_syntax_unsupported(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          unsupported: {}
-""").assert_failure()
-
-
-def test_node_type_requirement_syntax_empty(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    requirements:
-      - my_requirement: {} # "capability" is required
-""").assert_failure()
-
-
-# Capability
-
-@pytest.mark.parametrize('value', data.NOT_A_DICT_OR_STRING)
-def test_node_type_requirement_capability_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_requirement_capability_syntax_unsupported(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability:
-            unsupported: {}
-""").assert_failure()
-
-
-def test_node_type_requirement_capability_short_form(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement: MyType
-""").assert_success()
-
-
-# Capability type
-
-def test_node_type_requirement_capability_type_unknown(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: UnknownType
-""").assert_failure()
-
-
-def test_node_type_requirement_capability_type_override(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType1: {}
-  MyType2: {}
-node_types:
-  MyType1:
-    requirements:
-      - my_requirement:
-          capability: MyType1
-  MyType2:
-    derived_from: MyType1
-    requirements:
-      - my_requirement:
-          capability: MyType2 # you are allowed to change the capability type to anything
-""").assert_success()
-
-
-# Node
-
-@pytest.mark.parametrize('value', data.NOT_A_STRING)
-def test_node_type_requirement_node_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          node: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_requirement_node_unknown(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          node: UnknownType
-""").assert_failure()
-
-
-def test_node_type_requirement_node_override(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType1:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          node: MyType3
-  MyType2:
-    derived_from: MyType1
-    requirements:
-      - my_requirement:
-          capability: MyType
-          node: MyType4 # you are allowed to change the node type to anything
-  MyType3: {}
-  MyType4: {}
-""").assert_success()
-
-
-# Relationship
-
-@pytest.mark.parametrize('value', data.NOT_A_DICT_OR_STRING)
-def test_node_type_requirement_relationship_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_requirement_relationship_syntax_unsupported(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            unsupported: {}
-""").assert_failure()
-
-
-def test_node_type_requirement_relationship_short_form(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-relationship_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship: MyType
-""").assert_success()
-
-
-# Relationship type
-
-@pytest.mark.parametrize('value', data.NOT_A_DICT_OR_STRING)
-def test_node_type_requirement_relationship_type_syntax_type(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            type: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-def test_node_type_requirement_relationship_type_unknown(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            type: UnknownType
-""").assert_failure()
-
-
-def test_node_type_requirement_relationship_type_override(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-relationship_types:
-  MyType1: {}
-  MyType2: {}
-node_types:
-  MyType1:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            type: MyType1
-  MyType2:
-    derived_from: MyType1
-    requirements:
-      - my_requirement:
-          capability: MyType
-          relationship:
-            type: MyType2 # you are allowed to change the relationship type to anything
-""").assert_success()
-
-
-# Occurrences
-
-@pytest.mark.parametrize('value', data.OCCURRENCES)
-def test_node_type_requirement_occurrences(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          occurrences: {{ value }}
-""", dict(value=value)).assert_success()
-
-
-@pytest.mark.parametrize('value', data.BAD_OCCURRENCES)
-def test_node_type_requirement_occurrences_bad(parser, value):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  MyType: {}
-node_types:
-  MyType:
-    requirements:
-      - my_requirement:
-          capability: MyType
-          occurrences: {{ value }}
-""", dict(value=value)).assert_failure()
-
-
-# Unicode
-
-def test_node_type_requirement_unicode(parser):
-    parser.parse_literal("""
-tosca_definitions_version: tosca_simple_yaml_1_0
-capability_types:
-  類型: {}
-relationship_types:
-  類型: {}
-node_types:
-  類型:
-    requirements:
-      - 需求:
-          capability: 類型
-          node: 類型
-          relationship:
-            type: 類型
-          occurrences: [ 0, UNBOUNDED ]
-""").assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/mechanisms/parsing/__init__.py
----------------------------------------------------------------------
diff --git a/tests/mechanisms/parsing/__init__.py b/tests/mechanisms/parsing/__init__.py
index 1e6750a..2316eb0 100644
--- a/tests/mechanisms/parsing/__init__.py
+++ b/tests/mechanisms/parsing/__init__.py
@@ -51,13 +51,13 @@ class Parser(object):
     def __init__(self):
         self.verbose = False
 
-    def parse_literal(self, text, context=None, import_profile=False):
+    def parse_literal(self, text, context=None, import_profile=False, validate_normative=False):
         text = render(text, context)
-        parsed = self._parse_literal(text, import_profile)
+        parsed = self._parse_literal(text, import_profile, validate_normative)
         parsed.verbose = self.verbose
         return parsed
 
-    def _parse_literal(self, text, import_profile):
+    def _parse_literal(self, text, import_profile, validate_normative):
         raise NotImplementedError
 
     def __enter__(self):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/mechanisms/parsing/aria.py
----------------------------------------------------------------------
diff --git a/tests/mechanisms/parsing/aria.py b/tests/mechanisms/parsing/aria.py
index c9b4630..66c7f09 100644
--- a/tests/mechanisms/parsing/aria.py
+++ b/tests/mechanisms/parsing/aria.py
@@ -29,8 +29,9 @@ from . import (Parser, Parsed)
 
 
 class AriaParser(Parser):
-    def _parse_literal(self, text, import_profile):
-        context = AriaParser.create_context(import_profile=import_profile)
+    def _parse_literal(self, text, import_profile, validate_normative):
+        context = AriaParser.create_context(import_profile=import_profile,
+                                            validate_normative=validate_normative)
         context.presentation.location = LiteralLocation(text)
         consumer = AriaParser.create_consumer(context)
         consumer.consume()
@@ -47,7 +48,8 @@ class AriaParser(Parser):
                        presenter=None,
                        debug=False,
                        cache=True,
-                       import_profile=True):
+                       import_profile=True,
+                       validate_normative=True):
         context = ConsumptionContext()
         context.loading.loader_source = import_fullname(loader_source)()
         context.reading.reader_source = import_fullname(reader_source)()
@@ -56,6 +58,7 @@ class AriaParser(Parser):
         context.presentation.threads = 1 # tests already run in maximum thread density
         context.presentation.cache = cache
         context.presentation.import_profile = import_profile
+        context.presentation.validate_normative = validate_normative
         context.presentation.print_exceptions = debug
         return context
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/topology/test_configuration.py
----------------------------------------------------------------------
diff --git a/tests/topology/test_configuration.py b/tests/topology/test_configuration.py
index 6552486..2a3bcae 100644
--- a/tests/topology/test_configuration.py
+++ b/tests/topology/test_configuration.py
@@ -15,10 +15,10 @@
 
 import pytest
 
-from .service_templates import consume_literal
-
 from aria.modeling.utils import parameters_as_values
 
+from .service_templates import consume_literal
+
 
 TEMPLATE = """
 tosca_definitions_version: tosca_simple_yaml_1_0

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9fe6e7cd/tests/topology/utils.py
----------------------------------------------------------------------
diff --git a/tests/topology/utils.py b/tests/topology/utils.py
index 5a98cf2..47cc45e 100644
--- a/tests/topology/utils.py
+++ b/tests/topology/utils.py
@@ -40,6 +40,7 @@ def create_context(uri,
     context.presentation.presenter_source = import_fullname(presenter_source)()
     context.presentation.presenter_class = import_fullname(presenter)
     context.presentation.threads = 1 # tests already run in maximum thread density
+    context.presentation.validate_normative = False # we have special tests for normative types
     context.presentation.print_exceptions = debug
     return context
 


Mime
View raw message