X-Git-Url: https://gerrit.onap.org/r/gitweb?p=vvp%2Fvalidation-scripts.git;a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_nested_parameters.py;h=97d2f76d47c2e4e814c9b8fb079c12a54d9020b0;hp=47c4d90c3b32c95edf8c922aee90dad670f28bd9;hb=1bc097aa957e560147b4d9af49d25e69a6692702;hpb=39119b4e131155ae38f7b435fc9f3693ca924eed diff --git a/ice_validator/tests/test_nested_parameters.py b/ice_validator/tests/test_nested_parameters.py index 47c4d90..97d2f76 100644 --- a/ice_validator/tests/test_nested_parameters.py +++ b/ice_validator/tests/test_nested_parameters.py @@ -81,7 +81,12 @@ def check_nested_parameter_doesnt_change(yaml_file, nresource_type, *nprops): r = Resource(resource_id=resource_id, resource=resource) properties = r.get_nested_properties() resources = r.get_nested_yaml(base_dir).get("resources", {}) - for nrid, nresource_dict in resources.items(): # iterate through nested file until found target r type + for ( + nrid, + nresource_dict, + ) in ( + resources.items() + ): # iterate through nested file until found target r type if ( nresource_dict.get("type") @@ -89,10 +94,19 @@ def check_nested_parameter_doesnt_change(yaml_file, nresource_type, *nprops): ): continue - for nparam in prop_iterator(nresource_dict, *nprops): # get iterator of all target parameters - if nparam and "get_param" in nparam: # iterator yields None if parameter isn't found + for nparam in prop_iterator( + nresource_dict, *nprops + ): # get iterator of all target parameters + if ( + nparam and "get_param" in nparam + ): # iterator yields None if parameter isn't found nparam = nparam.get("get_param") - for k1, v1 in properties.items(): # found nparam, now comparing to parent template + for ( + k1, + v1, + ) in ( + properties.items() + ): # found nparam, now comparing to parent template if isinstance(v1, dict) and "get_param" in v1: parameter = v1.get("get_param") # k1: nested resource parameter definition @@ -105,7 +119,9 @@ def check_nested_parameter_doesnt_change(yaml_file, nresource_type, *nprops): if isinstance(parameter, list): parameter = parameter[0] - if k1 != nparam: # we only care about the parameter we found in nested template + if ( + k1 != nparam + ): # we only care about the parameter we found in nested template continue if k1 != parameter: @@ -129,6 +145,7 @@ def check_nested_parameter_doesnt_change(yaml_file, nresource_type, *nprops): # def test_parameter_name_doesnt_change_in_nested_template(yaml_file): # check_nested_parameter_doesnt_change(yaml_file) + @validates("R-708564") def test_server_name_parameter_name_doesnt_change_in_nested_template(heat_template): check_nested_parameter_doesnt_change(heat_template, "OS::Nova::Server", "name") @@ -257,7 +274,7 @@ def test_vmi_aap_parameter_name_doesnt_change_in_nested_template(heat_template): "virtual_machine_interface_allowed_address_pairs", "virtual_machine_interface_allowed_address_pairs_allowed_address_pair", "virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip", - "virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip_ip_prefix" + "virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip_ip_prefix", )