TerekhovaKate commented on code in PR #7424:
URL: https://github.com/apache/trafficcontrol/pull/7424#discussion_r1154620540
##########
traffic_ops/testing/api_contract/v4/test_cdns.py:
##########
@@ -98,17 +64,25 @@ def test_cdn_contract(
cdn_keys = set(first_cdn.keys())
logger.info("CDN Keys from cdns endpoint response %s", cdn_keys)
+ response_template =
response_template_data.get("cdns").get("properties")
# validate cdn values from prereq data in cdns get response.
prereq_values = [
cdn_post_data["name"],
cdn_post_data["domainName"],
cdn_post_data["dnssecEnabled"]
]
get_values = [first_cdn["name"], first_cdn["domainName"],
first_cdn["dnssecEnabled"]]
- # validate data types for values from cdn get json response.
- for (prereq_value, get_value) in zip(prereq_values, get_values):
- assert isinstance(prereq_value, type(get_value))
- assert cdn_keys == set(cdn_post_data.keys())
+ get_types = {}
+ for key in first_cdn:
+ get_types[key] = first_cdn[key].__class__.__name__
Review Comment:
why you are using magic __ _methods_ __ to get key name?
please explore easy way to log the info without creating new dictionaty
variable with the loop
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]