diff options
author | stark, steven <steven.stark@att.com> | 2018-12-17 12:43:02 -0800 |
---|---|---|
committer | stark, steven <steven.stark@att.com> | 2018-12-17 13:04:00 -0800 |
commit | 1f4df7c7ad27b23773ad9cdbe4db1632ce388cf1 (patch) | |
tree | 8092104f8be23051ff81c9f71ee34116df4d33ba /ice_validator/tests/test_heat_pairs_provided.py | |
parent | ca9085f0f77d442d3741a8c754e65cc45b6a318d (diff) |
[VVP] updating validation scripts in dublin
- adding backlog of new validation scripts for dublin
- updating existing tests
- removing outdated tests
Issue-ID: VVP-123
Change-Id: Ib8260889ac957c1dd28d8ede450fc8edc6fb0ec0
Signed-off-by: stark, steven <steven.stark@att.com>
Diffstat (limited to 'ice_validator/tests/test_heat_pairs_provided.py')
-rw-r--r-- | ice_validator/tests/test_heat_pairs_provided.py | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/ice_validator/tests/test_heat_pairs_provided.py b/ice_validator/tests/test_heat_pairs_provided.py index 76aa276..fd6c95b 100644 --- a/ice_validator/tests/test_heat_pairs_provided.py +++ b/ice_validator/tests/test_heat_pairs_provided.py @@ -43,24 +43,54 @@ from os import path from .helpers import validates -@validates('R-86285', 'R-38474', 'R-81725', 'R-53433', 'R-56438', - 'R-74304', 'R-91342', 'R-94509', 'R-31141') +@validates( + "R-86285", + "R-38474", + "R-81725", + "R-53433", + "R-56438", + "R-74304", + "R-91342", + "R-94509", + "R-31141", +) def test_heat_pairs_provided(heat_templates, env_files, volume_templates): - ''' + """ Check that every yaml file is submitted with an associated env file, and every env has an associated yaml file. - ''' + """ + env_files_missing_template = [] for filename in env_files: basename = path.splitext(filename)[0] - assert basename + '.yaml' in heat_templates or \ - basename + '.yml' in heat_templates or \ - basename + '.yml' in volume_templates or \ - basename + '.yaml' in volume_templates + if not ( + basename + ".yaml" in heat_templates + or basename + ".yml" in heat_templates + or basename + ".yml" in volume_templates + or basename + ".yaml" in volume_templates + ): + env_files_missing_template.append(filename) + + heat_template_missing_env = [] for filename in heat_templates: basename = path.splitext(filename)[0] - assert basename + '.env' in env_files + if not basename + ".env" in env_files: + heat_template_missing_env.append(filename) + for filename in volume_templates: basename = path.splitext(filename)[0] - assert basename + '.env' in env_files + if not basename + ".env" in env_files: + heat_template_missing_env.append(filename) + + msg = ( + "Mismatched template and environment file pairs detected. " + + "Environment files with no matching template: {} ".format( + env_files_missing_template + ) + + "Heat templates with no matching environment file: {}".format( + heat_template_missing_env + ) + ) + + assert not (env_files_missing_template or heat_template_missing_env), msg |