aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator/tests
diff options
context:
space:
mode:
authorLovett, Trevor <trevor.lovett@att.com>2019-01-29 14:41:53 -0600
committerLovett, Trevor <trevor.lovett@att.com>2019-01-29 15:36:14 -0600
commitf9458c335c418e18b1b992fe47f7d4cbf823735f (patch)
treebb9a25fcb465c816e434055d8deea978b2ad069e /ice_validator/tests
parent961f572383ff3398bcafc802682b92f23f8ab1fe (diff)
[VVP] Fixing mapping issues
Updated to the latest version of the needs.json R-52530 was removed and replaced with R-511776 which is already covered by a different test. test_07_nested_template_in_same_directory: the only remaining purpose of this method was to test for the existence of the nested file, but this is already covered by test_valid_nesting I mapped the unmapped tests in test_inital_configuration to to the requirement that states the templates must be valid Heat Change-Id: Ia71d774df8873ebb4182f44eb66b108f9ff24d20 Issue-ID: VVP-142 Signed-off-by: Lovett, Trevor <trevor.lovett@att.com>
Diffstat (limited to 'ice_validator/tests')
-rw-r--r--ice_validator/tests/test_initial_configuration.py38
1 files changed, 3 insertions, 35 deletions
diff --git a/ice_validator/tests/test_initial_configuration.py b/ice_validator/tests/test_initial_configuration.py
index 6a91567..83f887c 100644
--- a/ice_validator/tests/test_initial_configuration.py
+++ b/ice_validator/tests/test_initial_configuration.py
@@ -35,10 +35,6 @@
#
# ============LICENSE_END============================================
#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-#
-import os
-from os import listdir
from os import path
import pytest
@@ -51,14 +47,9 @@ from .helpers import validates
from yamllint.config import YamlLintConfig
from yamllint import linter
from .utils.nested_files import check_for_invalid_nesting
-from .utils.nested_files import get_list_of_nested_files
from .utils.nested_iterables import find_all_get_resource_in_yml
from .utils.nested_iterables import find_all_get_param_in_yml
-"""
-Order tests by number so they execute in order for base tests
-"""
-
@pytest.mark.base
@validates("R-95303")
@@ -105,6 +96,7 @@ def test_02_no_duplicate_keys_in_file(yaml_file):
@pytest.mark.base
+@validates("R-92635")
def test_03_all_referenced_resources_exists(yaml_file):
"""
Check that all resources referenced by get_resource
@@ -137,6 +129,7 @@ def test_03_all_referenced_resources_exists(yaml_file):
@pytest.mark.base
+@validates("R-92635")
def test_04_valid_nesting(yaml_file):
"""
Check that the nesting is following the proper format and
@@ -162,6 +155,7 @@ def test_04_valid_nesting(yaml_file):
@pytest.mark.base
+@validates("R-92635")
def test_05_all_get_param_have_defined_parameter(yaml_file):
"""
Check that all referenced parameters are actually defined
@@ -207,29 +201,3 @@ def test_06_heat_template_resource_section_has_resources(heat_template):
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)
-
- assert (
- not missing_files
- ), "Missing nested files in heat template directory {}".format(missing_files)