ericholguin commented on code in PR #7458:
URL: https://github.com/apache/trafficcontrol/pull/7458#discussion_r1189074950


##########
traffic_ops/testing/api_contract/v4/conftest.py:
##########
@@ -716,3 +716,62 @@ def server_capabilities_post_data(to_session: TOSession, 
request_template_data:
        except IndexError:
                logger.error("No server_capabilities response data from 
server_capabilities POST request.")
                sys.exit(1)
+
[email protected]()
+def region_post_data(to_session: TOSession, request_template_data: 
list[JSONData]
+                     ) -> dict[str, object]:
+       """
+       PyTest Fixture to create POST data for region endpoint.
+
+       :param to_session: Fixture to get Traffic Ops session.
+       :param request_template_data: Fixture to get region data from a 
prerequisites file.
+  :returns: Sample POST data and the actual API response.

Review Comment:
   tab?



##########
traffic_ops/testing/api_contract/v4/conftest.py:
##########
@@ -716,3 +716,62 @@ def server_capabilities_post_data(to_session: TOSession, 
request_template_data:
        except IndexError:
                logger.error("No server_capabilities response data from 
server_capabilities POST request.")
                sys.exit(1)
+
[email protected]()
+def region_post_data(to_session: TOSession, request_template_data: 
list[JSONData]
+                     ) -> dict[str, object]:
+       """
+       PyTest Fixture to create POST data for region endpoint.
+
+       :param to_session: Fixture to get Traffic Ops session.
+       :param request_template_data: Fixture to get region data from a 
prerequisites file.
+  :returns: Sample POST data and the actual API response.
+       """
+
+       try:
+       region = request_template_data[0]
+       except IndexError as e:
+               raise TypeError(
+                       "malformed prerequisite data; no Region present in 
'regions' array property") from e
+
+       if not isinstance(region, dict):
+               raise TypeError(f"malformed prerequisite data; region must be 
objects, not '{type(region)}'")
+
+       # Return new post data and post response from divisions POST request

Review Comment:
   should be regions not divisions



##########
traffic_ops/testing/api_contract/v4/request_template.json:
##########
@@ -55,5 +55,18 @@
                {
                        "name": "RAM"
                }
-       ]
-}
+       ],
+  "divisions": [
+               {
+                       "name": "test"
+               }
+       ],
+       "regions": [
+               {
+                       "divisionName": "Quebec",
+                       "division": 1,
+                       "name": "Montreal"
+    }
+   ]
+ }

Review Comment:
   can you fix formatting here, looks off



##########
traffic_ops/testing/api_contract/v4/conftest.py:
##########
@@ -635,6 +635,7 @@ def tenant_post_data(to_session: TOSession, 
request_template_data: list[JSONData
                  ) -> dict[str, object]:
        """
        PyTest Fixture to create POST data for tenants endpoint.
+

Review Comment:
   Shouldnt have an extra newline here



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