X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_vm_type_resource_id.py;h=03bb85b05064a6d8276feda752bf7336b7760c2a;hb=00c64458942602efe5a3b712540b98ac94fb60f4;hp=beb67458c0bfbd8a8b829f83f667789bbec19943;hpb=60d5ad7d00eadd6395eca186e6fa76a43df3c6cf;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/test_vm_type_resource_id.py b/ice_validator/tests/test_vm_type_resource_id.py index beb6745..03bb85b 100644 --- a/ice_validator/tests/test_vm_type_resource_id.py +++ b/ice_validator/tests/test_vm_type_resource_id.py @@ -35,11 +35,10 @@ # # ============LICENSE_END============================================ # -# ECOMP is a trademark and service mark of AT&T Intellectual Property. # -'''vm-type resource_id -''' +"""vm-type resource_id +""" import pytest @@ -47,29 +46,28 @@ from .structures import Heat from .helpers import validates from .utils import vm_types as utils_vm_types -VERSION = '1.1.0' +VERSION = "1.1.0" -@validates('R-46839') -def test_vm_type_resource_id(heat_template): - ''' +@validates("R-46839") +def test_vm_type_resource_id(yaml_file): + """ A VNF's Heat Orchestration Template's use of ``{vm-type}`` in all Resource IDs **MUST** be the same case. - ''' + """ bad = {} - h = Heat(filepath=heat_template) + h = Heat(filepath=yaml_file) if not h.resources: pytest.skip("No resources specified in the heat template") - vm_types = {v + '_': v.lower() + '_' - for v in utils_vm_types.get_vm_types(h.resources)} + vm_types = { + v + "_": v.lower() + "_" for v in utils_vm_types.get_vm_types(h.resources) + } if not vm_types: pytest.skip("No {vm-type} specified in the heat template") for rid in h.resources: lower_rid = rid.lower() for vm_type, lower_vm_type in vm_types.items(): - if (lower_rid.startswith(lower_vm_type) - and not rid.startswith(vm_type)): - bad[rid] = vm_type - assert not bad, 'resource_id which do not match their vm-type %s' % bad - + if lower_rid.startswith(lower_vm_type) and not rid.startswith(vm_type): + bad[rid] = vm_type + assert not bad, "resource_id which do not match their vm-type %s" % bad