gokulakrishnansvm commented on code in PR #7424:
URL: https://github.com/apache/trafficcontrol/pull/7424#discussion_r1162271503


##########
traffic_ops/testing/api_contract/v4/test_cachegroups.py:
##########
@@ -60,30 +64,40 @@ def test_cachegroup_contract(to_session: TOSession, 
request_template_data:
                if not isinstance(first_cachegroup, dict):
                        raise TypeError("malformed API response; first Cache 
group in response is not an object")
                cachegroup_keys = set(first_cachegroup.keys())
-
                logger.info("Cache group Keys from cachegroup endpoint response 
%s", cachegroup_keys)
-               response_template = 
response_template_data.get("cachegroup").get("properties")
+
+               cachegroup_response_template = 
response_template_data.get("cachegroup")
+               response_template = 
cachegroup_response_template.get("properties") if isinstance(
+                       cachegroup_response_template, dict) else None
+               if response_template is None or not 
isinstance(response_template, dict):

Review Comment:
   Added type annotation for response template to avoid typing issues for both 
cachegroups and cdns test cases.



-- 
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]

Reply via email to