X-Git-Url: https://gerrit.onap.org/r/gitweb?p=vvp%2Fvalidation-scripts.git;a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_network_format.py;h=23e46f9d3bff90d53d2387a11361fc82c1fb6e03;hp=98fcd3785b1cb2aa3f244270df00ffde14b63824;hb=1d281ce111a76c2b056bcaa572c1e929c90237cf;hpb=d78c645df31a19567667d3e6d3acdf0474f39bf1 diff --git a/ice_validator/tests/test_network_format.py b/ice_validator/tests/test_network_format.py index 98fcd37..23e46f9 100644 --- a/ice_validator/tests/test_network_format.py +++ b/ice_validator/tests/test_network_format.py @@ -38,7 +38,6 @@ # from itertools import chain -import pytest import re from tests import cached_yaml as yaml @@ -78,13 +77,9 @@ def test_network_has_subnet(yaml_file): 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") - networks = [] - for k, v in yml["resources"].items(): + for k, v in yml.get("resources", {}).items(): if not has_properties(v) or v.get("type") not in ["OS::Neutron::Net"]: continue # need to check if contrail networks also require subnet @@ -92,7 +87,7 @@ def test_network_has_subnet(yaml_file): # if v.get("type") not in NETWORK_RESOURCE_TYPES: networks.append(k) - for k, v in yml["resources"].items(): + for k, v in yml.get("resources", {}).items(): network_prop = v.get("properties", {}).get("network", {}).get("get_resource") if ( not has_properties(v)