X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FALTO%2FAltoParser.py;h=86e5701af3a70bba92fd828019afb9910a489e2c;hb=1c106006ffb33c1c60e2f8abe61e88a7bd95a7bd;hp=0174ae06fafacce72c6c2ca384e80d24b232312d;hpb=e235045c2ad12d41416e2583609a0178c8bd9287;p=integration%2Ftest.git diff --git a/csit/libraries/ALTO/AltoParser.py b/csit/libraries/ALTO/AltoParser.py index 0174ae06fa..86e5701af3 100644 --- a/csit/libraries/ALTO/AltoParser.py +++ b/csit/libraries/ALTO/AltoParser.py @@ -9,17 +9,18 @@ import re content_key_set = {"meta", "resources"} resource_key_set = {"uri", "media-type", "accepts", "capabilities", "uses"} cost_type_key_set = {"cost-mode", "cost-metric", "description"} -media_type_set = {"application/alto-directory+json", - "application/alto-networkmap+json", - "application/alto-networkmapfilter+json", - "application/alto-costmap+json", - "application/alto-costmapfilter+json", - "application/alto-endpointprop+json", - "application/alto-endpointpropparams+json", - "application/alto-endpointcost+json", - "application/alto-endpointcostparams+json", - "application/alto-error+json" - } +media_type_set = { + "application/alto-directory+json", + "application/alto-networkmap+json", + "application/alto-networkmapfilter+json", + "application/alto-costmap+json", + "application/alto-costmapfilter+json", + "application/alto-endpointprop+json", + "application/alto-endpointpropparams+json", + "application/alto-endpointcost+json", + "application/alto-endpointcostparams+json", + "application/alto-error+json", +} def get_basic_info(response): @@ -64,9 +65,13 @@ def check_ird_configuration_entry(response, ird_resource_id, context_id, resourc for tag in context_tags: if "dependency" in tag: for one_dependency in tag["dependency"]: - _context_id = re.findall("\d{8}-\d{4}-\d{4}-\d{4}-\d{12}", one_dependency)[0] + _context_id = re.findall( + "\d{8}-\d{4}-\d{4}-\d{4}-\d{12}", one_dependency + )[0] if _context_id == context_id: - long_resource_id = re.findall("resource-id='[a-zA-Z\-]*'", one_dependency)[0] + long_resource_id = re.findall( + "resource-id='[a-zA-Z\-]*'", one_dependency + )[0] short_resource_id = re.findall("'.*'", long_resource_id)[0] _resource_id = short_resource_id.replace("'", "") if _resource_id == resource_id: @@ -107,7 +112,10 @@ def verify_ird(response): resources = resp["resources"] for resource in resources.keys(): if set(resources[resource].keys()).issubset(resource_key_set): - if "uri" not in resources[resource] or "media-type" not in resources[resource]: + if ( + "uri" not in resources[resource] + or "media-type" not in resources[resource] + ): return False else: _resource = resources[resource]