diff options
author | stark, steven <steven.stark@att.com> | 2019-08-21 11:12:39 -0700 |
---|---|---|
committer | stark, steven <steven.stark@att.com> | 2019-08-21 11:25:01 -0700 |
commit | b1df832ae5ddaac6344b7ccf3f1f32a0bcfbdd67 (patch) | |
tree | ff5b1ae646b455607a73f6878a36fa195ddeff74 /ice_validator | |
parent | 2b57f73aad5c0a6755a7dfddc7e79937a74de00f (diff) |
[VVP] test_environment_file_parameters violation fix
test_environment_file_parameters check for environment violation is checking the wrong variable.
Also doesn't handle environment files with no parameters gracefully.
Issue-ID: VVP-267
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: I9fbedbb5af4c045037131a7e7a7ca7f6c8febb14
Diffstat (limited to 'ice_validator')
-rw-r--r-- | ice_validator/tests/test_environment_file_parameters.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ice_validator/tests/test_environment_file_parameters.py b/ice_validator/tests/test_environment_file_parameters.py index 100e4a1..ff57c35 100644 --- a/ice_validator/tests/test_environment_file_parameters.py +++ b/ice_validator/tests/test_environment_file_parameters.py @@ -268,10 +268,11 @@ def env_violation(yaml_file, parameter, persistent): env_yaml = environment_pair.get("eyml") parameters = env_yaml.get("parameters", {}) in_env = False - for param, value in parameters.items(): - if re.match(parameter, parameter): - in_env = True - break + if parameters: # env file can be just parameters: + for param, value in parameters.items(): + if re.match(parameter, param): + in_env = True + break # confusing return. This function is looking for a violation. return not persistent == in_env |