-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"
-
-
-@validates("R-52530")
-@pytest.mark.base
-def test_07_nested_template_in_same_directory(yaml_file):
-
- missing_files = []
-
- with open(yaml_file) as fh:
- yml = yaml.load(fh)
-
- # skip if resources are not defined
- if "resources" not in yml:
- pytest.skip("No resources specified in the heat template")
-
- dirname = os.path.dirname(yaml_file)
- list_of_files = get_list_of_nested_files(yml, dirname)
- dir_files = listdir(dirname)
- for file in list_of_files:
- base_name = path.basename(file)
- if base_name not in dir_files:
- missing_files.append(base_name)
-
+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")