From: Lovett, Trevor Date: Fri, 19 Jul 2019 19:06:52 +0000 (-0500) Subject: [VVP] Update AZ tests to not apply to nested templates X-Git-Tag: 5.0.0~14 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=vvp%2Fvalidation-scripts.git;a=commitdiff_plain;h=a9104115f1334272759bb1815cfa497c3cca3b24 [VVP] Update AZ tests to not apply to nested templates Issue-ID: VVP-226 Change-Id: I91e97b1b73daf6be83c227ff2deeeb4e72213ed5 Signed-off-by: Lovett, Trevor --- diff --git a/ice_validator/tests/test_availability_zone.py b/ice_validator/tests/test_availability_zone.py index 7feefc9..aee6890 100644 --- a/ice_validator/tests/test_availability_zone.py +++ b/ice_validator/tests/test_availability_zone.py @@ -43,6 +43,7 @@ import re import pytest from tests import cached_yaml as yaml +from tests.utils import nested_files from .helpers import validates @@ -55,6 +56,9 @@ def test_availability_zone_naming(yaml_file): Make sure all availability zones are properly formatted """ + if nested_files.file_is_a_nested_template(yaml_file): + pytest.skip("test does not apply to nested files") + with open(yaml_file) as fh: yml = yaml.load(fh) diff --git a/ice_validator/tests/test_availability_zone_params_start_at_0.py b/ice_validator/tests/test_availability_zone_params_start_at_0.py index 32a7484..3cffe46 100644 --- a/ice_validator/tests/test_availability_zone_params_start_at_0.py +++ b/ice_validator/tests/test_availability_zone_params_start_at_0.py @@ -36,15 +36,20 @@ # ============LICENSE_END============================================ import re +import pytest + from tests.helpers import validates, check_indices from tests.structures import Heat - +from tests.utils import nested_files AZ_PATTERN = re.compile(r"^(availability_zone_)(\d+)$") @validates("R-98450") def test_availability_zones_start_at_0(heat_template): + if nested_files.file_is_a_nested_template(heat_template): + pytest.skip("Test does not apply to nested files") + params = Heat(heat_template).parameters invalid_params = check_indices(AZ_PATTERN, params, "Availability Zone Parameters") assert not invalid_params, ". ".join(invalid_params)