|
|
@ -33,6 +33,15 @@ def ReadTestFile(filename):
|
|
|
|
return test_file.read()
|
|
|
|
return test_file.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def ReadImportFile(filename):
|
|
|
|
|
|
|
|
"""Returns {'content' : value} of a file from the test/ directory."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
full_path = GetFilePath() + '/../test/templates/' + filename
|
|
|
|
|
|
|
|
test_file = open(full_path, 'r')
|
|
|
|
|
|
|
|
return {'content': test_file.read(),
|
|
|
|
|
|
|
|
'path': full_path}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def GetTestBasePath(filename):
|
|
|
|
def GetTestBasePath(filename):
|
|
|
|
"""Returns the base path of a file from the testdata/ directory."""
|
|
|
|
"""Returns the base path of a file from the testdata/ directory."""
|
|
|
|
|
|
|
|
|
|
|
@ -79,7 +88,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_template.yaml')
|
|
|
|
template = ReadTestFile('jinja_template.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_template.jinja'] = ReadTestFile('jinja_template.jinja')
|
|
|
|
imports['jinja_template.jinja'] = ReadImportFile('jinja_template.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports)
|
|
|
|
template, imports)
|
|
|
@ -92,7 +101,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_noparams.yaml')
|
|
|
|
template = ReadTestFile('jinja_noparams.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_noparams.jinja'] = ReadTestFile('jinja_noparams.jinja')
|
|
|
|
imports['jinja_noparams.jinja'] = ReadImportFile('jinja_noparams.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports)
|
|
|
|
template, imports)
|
|
|
@ -105,7 +114,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('python_noparams.yaml')
|
|
|
|
template = ReadTestFile('python_noparams.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['python_noparams.py'] = ReadTestFile('python_noparams.py')
|
|
|
|
imports['python_noparams.py'] = ReadImportFile('python_noparams.py')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports)
|
|
|
|
template, imports)
|
|
|
@ -118,7 +127,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('python_template.yaml')
|
|
|
|
template = ReadTestFile('python_template.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['python_template.py'] = ReadTestFile('python_template.py')
|
|
|
|
imports['python_template.py'] = ReadImportFile('python_template.py')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports)
|
|
|
|
template, imports)
|
|
|
@ -131,10 +140,10 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('python_and_jinja_template.yaml')
|
|
|
|
template = ReadTestFile('python_and_jinja_template.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['python_and_jinja_template.py'] = ReadTestFile(
|
|
|
|
imports['python_and_jinja_template.py'] = ReadImportFile(
|
|
|
|
'python_and_jinja_template.py')
|
|
|
|
'python_and_jinja_template.py')
|
|
|
|
|
|
|
|
|
|
|
|
imports['python_and_jinja_template.jinja'] = ReadTestFile(
|
|
|
|
imports['python_and_jinja_template.jinja'] = ReadImportFile(
|
|
|
|
'python_and_jinja_template.jinja')
|
|
|
|
'python_and_jinja_template.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -165,9 +174,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_template_with_import.yaml')
|
|
|
|
template = ReadTestFile('jinja_template_with_import.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_template_with_import.jinja'] = ReadTestFile(
|
|
|
|
imports['jinja_template_with_import.jinja'] = ReadImportFile(
|
|
|
|
'jinja_template_with_import.jinja')
|
|
|
|
'jinja_template_with_import.jinja')
|
|
|
|
imports['helpers/common.jinja'] = ReadTestFile(
|
|
|
|
imports['helpers/common.jinja'] = ReadImportFile(
|
|
|
|
'helpers/common.jinja')
|
|
|
|
'helpers/common.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
yaml_template = yaml.safe_load(template)
|
|
|
|
yaml_template = yaml.safe_load(template)
|
|
|
@ -183,12 +192,11 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_template_with_inlinedfile.yaml')
|
|
|
|
template = ReadTestFile('jinja_template_with_inlinedfile.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_template_with_inlinedfile.jinja'] = ReadTestFile(
|
|
|
|
imports['jinja_template_with_inlinedfile.jinja'] = ReadImportFile(
|
|
|
|
'jinja_template_with_inlinedfile.jinja')
|
|
|
|
'jinja_template_with_inlinedfile.jinja')
|
|
|
|
imports['helpers/common.jinja'] = ReadTestFile(
|
|
|
|
imports['helpers/common.jinja'] = ReadImportFile(
|
|
|
|
'helpers/common.jinja')
|
|
|
|
'helpers/common.jinja')
|
|
|
|
|
|
|
|
imports['description_text.txt'] = ReadImportFile('description_text.txt')
|
|
|
|
imports['description_text.txt'] = ReadTestFile('description_text.txt')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yaml_template = yaml.safe_load(template)
|
|
|
|
yaml_template = yaml.safe_load(template)
|
|
|
|
|
|
|
|
|
|
|
@ -203,13 +211,12 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('python_template_with_import.yaml')
|
|
|
|
template = ReadTestFile('python_template_with_import.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['python_template_with_import.py'] = ReadTestFile(
|
|
|
|
imports['python_template_with_import.py'] = ReadImportFile(
|
|
|
|
'python_template_with_import.py')
|
|
|
|
'python_template_with_import.py')
|
|
|
|
|
|
|
|
imports['helpers/common.py'] = ReadImportFile('helpers/common.py')
|
|
|
|
imports['helpers/common.py'] = ReadTestFile('helpers/common.py')
|
|
|
|
imports['helpers/extra/common2.py'] = ReadImportFile(
|
|
|
|
imports['helpers/extra/common2.py'] = ReadTestFile(
|
|
|
|
|
|
|
|
'helpers/extra/common2.py')
|
|
|
|
'helpers/extra/common2.py')
|
|
|
|
imports['helpers/extra'] = ReadTestFile('helpers/extra/__init__.py')
|
|
|
|
imports['helpers/extra'] = ReadImportFile('helpers/extra/__init__.py')
|
|
|
|
|
|
|
|
|
|
|
|
yaml_template = yaml.safe_load(template)
|
|
|
|
yaml_template = yaml.safe_load(template)
|
|
|
|
|
|
|
|
|
|
|
@ -224,14 +231,12 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('python_template_with_inlinedfile.yaml')
|
|
|
|
template = ReadTestFile('python_template_with_inlinedfile.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['python_template_with_inlinedfile.py'] = ReadTestFile(
|
|
|
|
imports['python_template_with_inlinedfile.py'] = ReadImportFile(
|
|
|
|
'python_template_with_inlinedfile.py')
|
|
|
|
'python_template_with_inlinedfile.py')
|
|
|
|
|
|
|
|
imports['helpers/common.py'] = ReadImportFile('helpers/common.py')
|
|
|
|
imports['helpers/common.py'] = ReadTestFile('helpers/common.py')
|
|
|
|
imports['helpers/extra/common2.py'] = ReadImportFile(
|
|
|
|
imports['helpers/extra/common2.py'] = ReadTestFile(
|
|
|
|
|
|
|
|
'helpers/extra/common2.py')
|
|
|
|
'helpers/extra/common2.py')
|
|
|
|
|
|
|
|
imports['description_text.txt'] = ReadImportFile('description_text.txt')
|
|
|
|
imports['description_text.txt'] = ReadTestFile('description_text.txt')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yaml_template = yaml.safe_load(template)
|
|
|
|
yaml_template = yaml.safe_load(template)
|
|
|
|
|
|
|
|
|
|
|
@ -247,7 +252,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('python_template_with_env.yaml')
|
|
|
|
template = ReadTestFile('python_template_with_env.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['python_template_with_env.py'] = ReadTestFile(
|
|
|
|
imports['python_template_with_env.py'] = ReadImportFile(
|
|
|
|
'python_template_with_env.py')
|
|
|
|
'python_template_with_env.py')
|
|
|
|
|
|
|
|
|
|
|
|
env = {'project': 'my-project'}
|
|
|
|
env = {'project': 'my-project'}
|
|
|
@ -262,7 +267,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_template_with_env.yaml')
|
|
|
|
template = ReadTestFile('jinja_template_with_env.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_template_with_env.jinja'] = ReadTestFile(
|
|
|
|
imports['jinja_template_with_env.jinja'] = ReadImportFile(
|
|
|
|
'jinja_template_with_env.jinja')
|
|
|
|
'jinja_template_with_env.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
env = {'project': 'test-project', 'deployment': 'test-deployment'}
|
|
|
|
env = {'project': 'test-project', 'deployment': 'test-deployment'}
|
|
|
@ -297,7 +302,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('duplicate_names_in_subtemplates.yaml')
|
|
|
|
template = ReadTestFile('duplicate_names_in_subtemplates.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['duplicate_names_in_subtemplates.jinja'] = ReadTestFile(
|
|
|
|
imports['duplicate_names_in_subtemplates.jinja'] = ReadImportFile(
|
|
|
|
'duplicate_names_in_subtemplates.jinja')
|
|
|
|
'duplicate_names_in_subtemplates.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -312,9 +317,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('duplicate_names_mixed_level.yaml')
|
|
|
|
template = ReadTestFile('duplicate_names_mixed_level.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['duplicate_names_B.jinja'] = ReadTestFile(
|
|
|
|
imports['duplicate_names_B.jinja'] = ReadImportFile(
|
|
|
|
'duplicate_names_B.jinja')
|
|
|
|
'duplicate_names_B.jinja')
|
|
|
|
imports['duplicate_names_C.jinja'] = ReadTestFile(
|
|
|
|
imports['duplicate_names_C.jinja'] = ReadImportFile(
|
|
|
|
'duplicate_names_C.jinja')
|
|
|
|
'duplicate_names_C.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -328,7 +333,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('duplicate_names_parent_child.yaml')
|
|
|
|
template = ReadTestFile('duplicate_names_parent_child.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['duplicate_names_B.jinja'] = ReadTestFile(
|
|
|
|
imports['duplicate_names_B.jinja'] = ReadImportFile(
|
|
|
|
'duplicate_names_B.jinja')
|
|
|
|
'duplicate_names_B.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -343,7 +348,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('no_resources.yaml')
|
|
|
|
template = ReadTestFile('no_resources.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['no_resources.py'] = ReadTestFile(
|
|
|
|
imports['no_resources.py'] = ReadImportFile(
|
|
|
|
'no_resources.py')
|
|
|
|
'no_resources.py')
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -361,9 +366,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_defaults.yaml')
|
|
|
|
template = ReadTestFile('jinja_defaults.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_defaults.jinja'] = ReadTestFile(
|
|
|
|
imports['jinja_defaults.jinja'] = ReadImportFile(
|
|
|
|
'jinja_defaults.jinja')
|
|
|
|
'jinja_defaults.jinja')
|
|
|
|
imports['jinja_defaults.jinja.schema'] = ReadTestFile(
|
|
|
|
imports['jinja_defaults.jinja.schema'] = ReadImportFile(
|
|
|
|
'jinja_defaults.jinja.schema')
|
|
|
|
'jinja_defaults.jinja.schema')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -378,8 +383,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('python_schema.yaml')
|
|
|
|
template = ReadTestFile('python_schema.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['python_schema.py'] = ReadTestFile('python_schema.py')
|
|
|
|
imports['python_schema.py'] = ReadImportFile('python_schema.py')
|
|
|
|
imports['python_schema.py.schema'] = ReadTestFile('python_schema.py.schema')
|
|
|
|
imports['python_schema.py.schema'] = ReadImportFile(
|
|
|
|
|
|
|
|
'python_schema.py.schema')
|
|
|
|
|
|
|
|
|
|
|
|
env = {'project': 'my-project'}
|
|
|
|
env = {'project': 'my-project'}
|
|
|
|
|
|
|
|
|
|
|
@ -395,9 +401,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_missing_required.yaml')
|
|
|
|
template = ReadTestFile('jinja_missing_required.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_missing_required.jinja'] = ReadTestFile(
|
|
|
|
imports['jinja_missing_required.jinja'] = ReadImportFile(
|
|
|
|
'jinja_missing_required.jinja')
|
|
|
|
'jinja_missing_required.jinja')
|
|
|
|
imports['jinja_missing_required.jinja.schema'] = ReadTestFile(
|
|
|
|
imports['jinja_missing_required.jinja.schema'] = ReadImportFile(
|
|
|
|
'jinja_missing_required.jinja.schema')
|
|
|
|
'jinja_missing_required.jinja.schema')
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -414,7 +420,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_unresolved.yaml')
|
|
|
|
template = ReadTestFile('jinja_unresolved.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_unresolved.jinja'] = ReadTestFile('jinja_unresolved.jinja')
|
|
|
|
imports['jinja_unresolved.jinja'] = ReadImportFile('jinja_unresolved.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
expansion.Expand(
|
|
|
|
expansion.Expand(
|
|
|
@ -428,9 +434,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('jinja_multiple_errors.yaml')
|
|
|
|
template = ReadTestFile('jinja_multiple_errors.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['jinja_multiple_errors.jinja'] = ReadTestFile(
|
|
|
|
imports['jinja_multiple_errors.jinja'] = ReadImportFile(
|
|
|
|
'jinja_multiple_errors.jinja')
|
|
|
|
'jinja_multiple_errors.jinja')
|
|
|
|
imports['jinja_multiple_errors.jinja.schema'] = ReadTestFile(
|
|
|
|
imports['jinja_multiple_errors.jinja.schema'] = ReadImportFile(
|
|
|
|
'jinja_multiple_errors.jinja.schema')
|
|
|
|
'jinja_multiple_errors.jinja.schema')
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -449,9 +455,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('python_bad_schema.yaml')
|
|
|
|
template = ReadTestFile('python_bad_schema.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['python_bad_schema.py'] = ReadTestFile(
|
|
|
|
imports['python_bad_schema.py'] = ReadImportFile(
|
|
|
|
'python_bad_schema.py')
|
|
|
|
'python_bad_schema.py')
|
|
|
|
imports['python_bad_schema.py.schema'] = ReadTestFile(
|
|
|
|
imports['python_bad_schema.py.schema'] = ReadImportFile(
|
|
|
|
'python_bad_schema.py.schema')
|
|
|
|
'python_bad_schema.py.schema')
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -472,7 +478,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('no_properties.yaml')
|
|
|
|
template = ReadTestFile('no_properties.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['no_properties.py'] = ReadTestFile(
|
|
|
|
imports['no_properties.py'] = ReadImportFile(
|
|
|
|
'no_properties.py')
|
|
|
|
'no_properties.py')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -487,9 +493,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('no_properties_schema_defaults.yaml')
|
|
|
|
template = ReadTestFile('no_properties_schema_defaults.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['no_properties_schema_defaults.py'] = ReadTestFile(
|
|
|
|
imports['no_properties_schema_defaults.py'] = ReadImportFile(
|
|
|
|
'no_properties_schema_defaults.py')
|
|
|
|
'no_properties_schema_defaults.py')
|
|
|
|
imports['no_properties_schema_defaults.py.schema'] = ReadTestFile(
|
|
|
|
imports['no_properties_schema_defaults.py.schema'] = ReadImportFile(
|
|
|
|
'no_properties_schema_defaults.py.schema')
|
|
|
|
'no_properties_schema_defaults.py.schema')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -503,13 +509,13 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('use_helper.yaml')
|
|
|
|
template = ReadTestFile('use_helper.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['use_helper.jinja'] = ReadTestFile(
|
|
|
|
imports['use_helper.jinja'] = ReadImportFile(
|
|
|
|
'use_helper.jinja')
|
|
|
|
'use_helper.jinja')
|
|
|
|
imports['use_helper.jinja.schema'] = ReadTestFile(
|
|
|
|
imports['use_helper.jinja.schema'] = ReadImportFile(
|
|
|
|
'use_helper.jinja.schema')
|
|
|
|
'use_helper.jinja.schema')
|
|
|
|
imports['helper.jinja'] = ReadTestFile(
|
|
|
|
imports['helper.jinja'] = ReadImportFile(
|
|
|
|
'helper.jinja')
|
|
|
|
'helper.jinja')
|
|
|
|
imports['helper.jinja.schema'] = ReadTestFile(
|
|
|
|
imports['helper.jinja.schema'] = ReadImportFile(
|
|
|
|
'helper.jinja.schema')
|
|
|
|
'helper.jinja.schema')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -536,7 +542,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/template.yaml')
|
|
|
|
template = ReadTestFile('outputs/template.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['simple.jinja'] = ReadTestFile(
|
|
|
|
imports['simple.jinja'] = ReadImportFile(
|
|
|
|
'outputs/simple.jinja')
|
|
|
|
'outputs/simple.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -550,7 +556,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/chain_outputs.yaml')
|
|
|
|
template = ReadTestFile('outputs/chain_outputs.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['simple.jinja'] = ReadTestFile(
|
|
|
|
imports['simple.jinja'] = ReadImportFile(
|
|
|
|
'outputs/simple.jinja')
|
|
|
|
'outputs/simple.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -564,8 +570,8 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/chain_multiple.yaml')
|
|
|
|
template = ReadTestFile('outputs/chain_multiple.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['simple.jinja'] = ReadTestFile('outputs/simple.jinja')
|
|
|
|
imports['simple.jinja'] = ReadImportFile('outputs/simple.jinja')
|
|
|
|
imports['one_simple.jinja'] = ReadTestFile('outputs/one_simple.jinja')
|
|
|
|
imports['one_simple.jinja'] = ReadImportFile('outputs/one_simple.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
@ -578,7 +584,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/consume_output.yaml')
|
|
|
|
template = ReadTestFile('outputs/consume_output.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['simple.jinja'] = ReadTestFile('outputs/simple.jinja')
|
|
|
|
imports['simple.jinja'] = ReadImportFile('outputs/simple.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
@ -591,8 +597,8 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/consume_multiple.yaml')
|
|
|
|
template = ReadTestFile('outputs/consume_multiple.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['simple.jinja'] = ReadTestFile('outputs/simple.jinja')
|
|
|
|
imports['simple.jinja'] = ReadImportFile('outputs/simple.jinja')
|
|
|
|
imports['one_consume.jinja'] = ReadTestFile('outputs/one_consume.jinja')
|
|
|
|
imports['one_consume.jinja'] = ReadImportFile('outputs/one_consume.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
@ -605,7 +611,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/list_output.yaml')
|
|
|
|
template = ReadTestFile('outputs/list_output.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['list_output.jinja'] = ReadTestFile('outputs/list_output.jinja')
|
|
|
|
imports['list_output.jinja'] = ReadImportFile('outputs/list_output.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
@ -618,7 +624,7 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/simple_up_down.yaml')
|
|
|
|
template = ReadTestFile('outputs/simple_up_down.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['instance_builder.jinja'] = ReadTestFile(
|
|
|
|
imports['instance_builder.jinja'] = ReadImportFile(
|
|
|
|
'outputs/instance_builder.jinja')
|
|
|
|
'outputs/instance_builder.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -632,9 +638,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/up_down.yaml')
|
|
|
|
template = ReadTestFile('outputs/up_down.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['frontend.jinja'] = ReadTestFile('outputs/frontend.jinja')
|
|
|
|
imports['frontend.jinja'] = ReadImportFile('outputs/frontend.jinja')
|
|
|
|
imports['backend.jinja'] = ReadTestFile('outputs/backend.jinja')
|
|
|
|
imports['backend.jinja'] = ReadImportFile('outputs/backend.jinja')
|
|
|
|
imports['instance_builder.jinja'] = ReadTestFile(
|
|
|
|
imports['instance_builder.jinja'] = ReadImportFile(
|
|
|
|
'outputs/instance_builder.jinja')
|
|
|
|
'outputs/instance_builder.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -648,9 +654,9 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/up_down.yaml')
|
|
|
|
template = ReadTestFile('outputs/up_down.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['frontend.jinja'] = ReadTestFile('outputs/frontend.jinja')
|
|
|
|
imports['frontend.jinja'] = ReadImportFile('outputs/frontend.jinja')
|
|
|
|
imports['backend.jinja'] = ReadTestFile('outputs/backend.jinja')
|
|
|
|
imports['backend.jinja'] = ReadImportFile('outputs/backend.jinja')
|
|
|
|
imports['instance_builder.jinja'] = ReadTestFile(
|
|
|
|
imports['instance_builder.jinja'] = ReadImportFile(
|
|
|
|
'outputs/instance_builder.jinja')
|
|
|
|
'outputs/instance_builder.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
@ -669,8 +675,8 @@ class ExpansionTest(unittest.TestCase):
|
|
|
|
template = ReadTestFile('outputs/conditional.yaml')
|
|
|
|
template = ReadTestFile('outputs/conditional.yaml')
|
|
|
|
|
|
|
|
|
|
|
|
imports = {}
|
|
|
|
imports = {}
|
|
|
|
imports['conditional.jinja'] = ReadTestFile('outputs/conditional.jinja')
|
|
|
|
imports['conditional.jinja'] = ReadImportFile('outputs/conditional.jinja')
|
|
|
|
imports['output_one.jinja'] = ReadTestFile('outputs/output_one.jinja')
|
|
|
|
imports['output_one.jinja'] = ReadImportFile('outputs/output_one.jinja')
|
|
|
|
|
|
|
|
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
expanded_template = expansion.Expand(
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
|
template, imports, validate_schema=True, outputs=True)
|
|
|
|