summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tests/test_toscatplvalidation.py
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tests/test_toscatplvalidation.py')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/test_toscatplvalidation.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/test_toscatplvalidation.py b/tosca2heat/tosca-parser/toscaparser/tests/test_toscatplvalidation.py
index a8b1590..ea27bcb 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/test_toscatplvalidation.py
+++ b/tosca2heat/tosca-parser/toscaparser/tests/test_toscatplvalidation.py
@@ -1442,6 +1442,17 @@ heat-translator/master/translator/tests/data/custom_types/wordpress.yaml
(_('The template version "tosca_xyz" is invalid. Valid versions '
'are "%s".') % valid_versions))
+ def test_import_invalid_type(self):
+ tosca_tpl = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ "data/test_import_invalid_type.yaml")
+ self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl)
+ exception.ExceptionCollector.assertExceptionMessage(
+ exception.UnknownFieldError,
+ (_("Template {'invalid': 'custom_types/invalid_type.yaml'} "
+ 'contains unknown field "annotation_types". Refer to the '
+ 'definition to verify valid values.')))
+
def test_node_template_capabilities_properties(self):
# validating capability property values
tpl_snippet = '''