Kashatlast2 commented on code in PR #7604:
URL: https://github.com/apache/trafficcontrol/pull/7604#discussion_r1272726823


##########
traffic_ops/testing/api_contract/v4/conftest.py:
##########
@@ -1017,4 +1017,40 @@ def coordinate_data_post(to_session: TOSession, 
request_template_data: list[JSON
        # Hitting coordinates POST methed
        response: tuple[JSONData, requests.Response] = 
to_session.create_coordinates(data=coordinate)
        resp_obj = check_template_data(response, "coordinate")
-       return resp_obj
+       yield resp_obj
+       coordinate_id = resp_obj.get("id")
+       msg = to_session.delete_coordinates(query_params={"id": coordinate_id})
+       logger.info("Deleting Coordinate data... %s", msg)
+       if msg is None:
+               logger.error("coordinate returned by Traffic Ops is missing an 
'id' property")
+               pytest.fail("Response from delete request is empty, Failing 
test_case")
+
[email protected](name="profile_parameters_post_data")
+def profile_parameters_data_post(to_session: TOSession, request_template_data: 
list[JSONData]
+                 ) -> dict[str, object]:
+       """
+       PyTest Fixture to create POST data for profile parameters endpoint.
+       :param to_session: Fixture to get Traffic Ops session.
+       :param request_template_data: Fixture to get profile parameters request 
template from a prerequisites file.
+       :returns: Sample POST data and the actual API response.
+       """
+
+       profile_parameters = 
check_template_data(request_template_data["profile_parameters"], 
"profile_parameters")
+
+       # Return new post data and post response from profile parameters POST 
request
+       profileId = profile_parameters["profileId"]
+       parameterId = profile_parameters["parameterId"]

Review Comment:
   get request added.



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