diff options
author | Lovett, Trevor <trevor.lovett@att.com> | 2020-01-17 12:26:18 -0600 |
---|---|---|
committer | Lovett, Trevor (tl2972) <tl2972@att.com> | 2020-01-17 12:27:39 -0600 |
commit | d8ffed96caada0308ac2ee3f4daf90b7aacb5137 (patch) | |
tree | 83ab7295bfae93153bf0e544232eca058d9b2d09 /ice_validator/tests/test_initial_configuration.py | |
parent | ded5c74ea07eb1541587de1042444fa6b590ddde (diff) |
[VVP] Allow base templates to not have resources
Change-Id: I44232d58697ff95b418e9594451cda3c3a90c798
Issue-ID: VVP-361
Signed-off-by: Lovett, Trevor <trevor.lovett@att.com>
Diffstat (limited to 'ice_validator/tests/test_initial_configuration.py')
-rw-r--r-- | ice_validator/tests/test_initial_configuration.py | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/ice_validator/tests/test_initial_configuration.py b/ice_validator/tests/test_initial_configuration.py index e4d8b01..13cc2c7 100644 --- a/ice_validator/tests/test_initial_configuration.py +++ b/ice_validator/tests/test_initial_configuration.py @@ -176,20 +176,10 @@ def test_05_all_get_param_have_defined_parameter(yaml_file): @validates("R-90152") @pytest.mark.base -def test_06_heat_template_resource_section_has_resources(heat_template): - - found_resource = False - - with open(heat_template) as fh: - yml = yaml.load(fh) - - resources = yml.get("resources") - if resources: - for k1, v1 in yml["resources"].items(): - if not isinstance(v1, dict): - continue - - found_resource = True - break - - assert found_resource, "Heat templates must contain at least one resource" +def test_06_heat_template_resource_section_has_resources(yaml_file): + template = load_yaml(yaml_file) + if "resources" not in template: + pytest.skip("No resources section") + assert ( + len(template["resources"]) > 0 + ), "If resources section present, then there must be at least 1 resource defined." |