Code Review
/
vvp
/
validation-scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Remove unnecessary check for pytest.skip"
[vvp/validation-scripts.git]
/
ice_validator
/
tests
/
test_non_server_name.py
diff --git
a/ice_validator/tests/test_non_server_name.py
b/ice_validator/tests/test_non_server_name.py
index
f56eef3
..
7a5c11f
100644
(file)
--- 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
"""
"""
resource property name
"""
-
+import os
import collections
import collections
-import pytest
-
from .structures import Heat
from .structures import HeatProcessor
from .helpers import validates
from .structures import Heat
from .structures import HeatProcessor
from .helpers import validates
+from tests.utils import nested_files
VERSION = "1.2.0"
VERSION = "1.2.0"
@@
-65,7
+64,7
@@
def get_non_servers(heat):
@validates("R-85734")
@validates("R-85734")
-def test_non_server_name(
heat_templat
e):
+def test_non_server_name(
yaml_fil
e):
"""
If a VNF's Heat Orchestration Template contains the property ``name``
for a non ``OS::Nova::Server`` resource, the intrinsic function
"""
If a VNF's Heat Orchestration Template contains the property ``name``
for a non ``OS::Nova::Server`` resource, the intrinsic function
@@
-73,13
+72,8
@@
def test_non_server_name(heat_template):
supplied metadata parameter ``vnf_name`` to generate a unique value.
"""
supplied metadata parameter ``vnf_name`` to generate a unique value.
"""
- h = Heat(filepath=heat_template)
- if not h.resources:
- pytest.skip("No resources in this template")
-
+ h = Heat(filepath=yaml_file)
non_servers = get_non_servers(h)
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():
bad = []
for rid, resource in non_servers.items():
@@
-148,11
+142,15
@@
def test_non_server_name(heat_template):
@validates("R-85734")
@validates("R-85734")
-def test_non_server_name_unique(
yaml_files
):
+def test_non_server_name_unique(
heat_template
):
"""Test name has unique value
"""
"""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 = {}
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)
h = Heat(filepath=yaml_file)
non_servers.update(get_non_servers(h))
names = collections.defaultdict(set)