X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_nova_servers_resource_ids.py;h=d8df655b8d2555da6a793a51b6be017a508f46db;hb=00c64458942602efe5a3b712540b98ac94fb60f4;hp=dd3e156254a654c12389f9e70f37718954ca2fc7;hpb=60d5ad7d00eadd6395eca186e6fa76a43df3c6cf;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/test_nova_servers_resource_ids.py b/ice_validator/tests/test_nova_servers_resource_ids.py index dd3e156..d8df655 100644 --- a/ice_validator/tests/test_nova_servers_resource_ids.py +++ b/ice_validator/tests/test_nova_servers_resource_ids.py @@ -35,22 +35,18 @@ # # ============LICENSE_END============================================ # -# ECOMP is a trademark and service mark of AT&T Intellectual Property. # - import pytest from tests import cached_yaml as yaml - from .helpers import validates from .utils.vm_types import get_vm_type_for_nova_server -@validates('R-40499', - 'R-57282') +@validates("R-40499", "R-57282") def test_nova_servers_valid_resource_ids(yaml_file): - ''' + """ Make sure all nova servers have valid resource ids - ''' + """ with open(yaml_file) as fh: yml = yaml.load(fh) @@ -85,14 +81,27 @@ def test_nova_servers_valid_resource_ids(yaml_file): int(k1_suffix) except ValueError: # vm_type_index is not an integer - invalid_nova_servers.append({"resource": k1, "vm_type": vm_type, "vm_type_index": k1_suffix}) + invalid_nova_servers.append( + { + "resource": k1, + "vm_type": vm_type, + "vm_type_index": k1_suffix, + } + ) else: # vm_type_index not found - invalid_nova_servers.append({"resource": k1, "vm_type": vm_type, "vm_type_index": "none found"}) + invalid_nova_servers.append( + { + "resource": k1, + "vm_type": vm_type, + "vm_type_index": "none found", + } + ) - assert not invalid_nova_servers, \ - "Invalid OS::Nova::Server resource ids detected {}\n" \ - "OS::Nova::Server resource ids must be in the form " \ - "_server_ \n" \ - " is derived from flavor, image and name properties " \ + assert not invalid_nova_servers, ( + "Invalid OS::Nova::Server resource ids detected {}. " + "OS::Nova::Server resource ids must be in the form " + "{{vm_type}}_server_{{vm_type_index}} where " + "{{vm_type}} is derived from flavor, image and name properties." "".format(invalid_nova_servers) + )