summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLokur, Manish <manish.shivakumar.lokur@att.com>2019-07-01 22:24:34 +0000
committerLokur, Manish <manish.shivakumar.lokur@att.com>2019-07-02 00:39:50 +0000
commitad3ccca5d510a1b2d5e138f72404d42e1f34af44 (patch)
tree28e3014d307cbc4a7727cbeef3104c75f23dc1a0
parentac00e6ea5fe3f53fa4d4b57e0e302f6bceca7066 (diff)
[VVP-230] Modified test_non_server_name_unique for non-server name uniqueness check
Used heat_template argument which loops through for each base template Created a list of base and it's nested templates for the test Issue-ID: VVP-230 Signed-off-by: Lokur, Manish <manish.shivakumar.lokur@att.com> Change-Id: I84d14ed61ac79d83894a47a79954f4ce8ac1615e
-rw-r--r--ice_validator/tests/test_non_server_name.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/ice_validator/tests/test_non_server_name.py b/ice_validator/tests/test_non_server_name.py
index c435916..7264ad0 100644
--- a/ice_validator/tests/test_non_server_name.py
+++ b/ice_validator/tests/test_non_server_name.py
@@ -40,14 +40,14 @@
"""
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"
@@ -148,11 +148,13 @@ 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)
@@ -165,4 +167,4 @@ def test_non_server_name_unique(yaml_files):
assert not bad, "Names must be unique," " not shared across resource ids.%s%s" % (
delim,
delim.join("%s: %s" % (name, list(value)) for name, value in bad.items()),
- )
+ ) \ No newline at end of file