X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_non_server_name.py;h=7a5c11f385d9c3aa46f828e5ffbdbb6f0f1a6f92;hb=ed4e48f967b1fccdd3fb142c0a166ee04ad6c2b0;hp=c435916c04267c46b17fcc1f19e3a3278e655921;hpb=10535815da964c683e5f91030934652bfb3f53b8;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/test_non_server_name.py b/ice_validator/tests/test_non_server_name.py index c435916..7a5c11f 100644 --- a/ice_validator/tests/test_non_server_name.py +++ b/ice_validator/tests/test_non_server_name.py @@ -40,14 +40,13 @@ """ resource property name """ - +import os import collections -import pytest - from .structures import Heat from .structures import HeatProcessor from .helpers import validates +from tests.utils import nested_files VERSION = "1.2.0" @@ -74,12 +73,7 @@ def test_non_server_name(yaml_file): """ h = Heat(filepath=yaml_file) - if not h.resources: - pytest.skip("No resources in this template") - non_servers = get_non_servers(h) - if not non_servers: - pytest.skip("No non-server resources in this template") bad = [] for rid, resource in non_servers.items(): @@ -148,11 +142,15 @@ def test_non_server_name(yaml_file): @validates("R-85734") -def test_non_server_name_unique(yaml_files): +def test_non_server_name_unique(heat_template): """Test name has unique value """ + list_nest = nested_files.get_list_of_nested_files( + heat_template, os.path.dirname(heat_template) + ) + list_nest.append(heat_template) non_servers = {} - for yaml_file in yaml_files: + for yaml_file in list_nest: h = Heat(filepath=yaml_file) non_servers.update(get_non_servers(h)) names = collections.defaultdict(set)