Closes-Bug: #1746532
Fix metadata section not supported in an imported file Edit Change-Id: I82fa8759984df8e238cbb66d6ef13d7705f30d2e
This commit is contained in:
parent
23cd991e88
commit
3af43cb9a8
@ -23,12 +23,13 @@ class TypeValidation(object):
|
||||
DATA_TYPES, ARTIFACT_TYPES, GROUP_TYPES,
|
||||
RELATIONSHIP_TYPES, CAPABILITY_TYPES,
|
||||
INTERFACE_TYPES, POLICY_TYPES,
|
||||
TOPOLOGY_TEMPLATE) = \
|
||||
TOPOLOGY_TEMPLATE, METADATA) = \
|
||||
('tosca_definitions_version', 'description', 'imports',
|
||||
'dsl_definitions', 'node_types', 'repositories',
|
||||
'data_types', 'artifact_types', 'group_types',
|
||||
'relationship_types', 'capability_types',
|
||||
'interface_types', 'policy_types', 'topology_template')
|
||||
'interface_types', 'policy_types', 'topology_template',
|
||||
'metadata')
|
||||
VALID_TEMPLATE_VERSIONS = ['tosca_simple_yaml_1_0']
|
||||
exttools = ExtTools()
|
||||
VALID_TEMPLATE_VERSIONS.extend(exttools.get_versions())
|
||||
|
12
toscaparser/tests/data/custom_types/template_metadata.yaml
Normal file
12
toscaparser/tests/data/custom_types/template_metadata.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
tosca_definitions_version: tosca_simple_yaml_1_0
|
||||
|
||||
metadata:
|
||||
template_name: name
|
||||
template_version: 1.0.0
|
||||
template_author: me
|
||||
|
||||
node_types:
|
||||
|
||||
tosca.nodes.SomeNode:
|
||||
derived_from: tosca.nodes.SoftwareComponent
|
||||
|
13
toscaparser/tests/data/test_import_metadata.yml
Normal file
13
toscaparser/tests/data/test_import_metadata.yml
Normal file
@ -0,0 +1,13 @@
|
||||
tosca_definitions_version: tosca_simple_yaml_1_0
|
||||
|
||||
imports:
|
||||
- invalid: custom_types/template_metadata.yaml
|
||||
|
||||
description: >
|
||||
Test to import a template with metadata
|
||||
|
||||
topology_template:
|
||||
node_templates:
|
||||
test:
|
||||
type: tosca.nodes.SomeNode
|
||||
|
@ -1453,6 +1453,12 @@ heat-translator/master/translator/tests/data/custom_types/wordpress.yaml
|
||||
'{\'invalid\': \'custom_types/invalid_template_version.yaml\'}"'
|
||||
' is invalid. Valid versions are "%s".') % valid_versions))
|
||||
|
||||
def test_import_template_metadata(self):
|
||||
tosca_tpl = os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"data/test_import_metadata.yml")
|
||||
ToscaTemplate(tosca_tpl)
|
||||
|
||||
def test_node_template_capabilities_properties(self):
|
||||
# validating capability property values
|
||||
tpl_snippet = '''
|
||||
|
Loading…
x
Reference in New Issue
Block a user