Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Faraz Maqsood authored and Muhammad Faraz Maqsood committed Sep 16, 2024
1 parent 7a88b9e commit f53871c
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ def perform_request(method, url, data_or_params=None, raw=False,
)

# For the better logging
response_to_log_and_compare = (
response.json() if response.content else response.content
)
log.info(
"""
======> FORUM <======
Expand All @@ -90,7 +87,7 @@ def perform_request(method, url, data_or_params=None, raw=False,
response: {response}
======> END <======
""".format(method=method, url=url, params=params, data=data, response=response_to_log_and_compare)
""".format(method=method, url=url, params=params, data=data, response=response.json())
)

if method == "get":
Expand All @@ -103,17 +100,12 @@ def perform_request(method, url, data_or_params=None, raw=False,
headers=headers,
timeout=config.connection_timeout,
)
forum_v1_response_to_log_and_compare = (
forum_v1_response.json()
if forum_v1_response.content
else forum_v1_response.content
)
log.info(f"requested forum proxey url: {url}")
log.info(f"requested forum v1 url: {forum_v1_url}")
if forum_v1_response_to_log_and_compare != response_to_log_and_compare:
if forum_v1_response.json() != response.json():
log.error(
f"Forum v2 difference, for endpoint {forum_v1_url} with params={params}. \
Expected: {forum_v1_response_to_log_and_compare}. Got: {response_to_log_and_compare}."
Expected: {forum_v1_response.json()}. Got: {response.json()}."
)

metric_tags.append(f'status_code:{response.status_code}')
Expand Down

0 comments on commit f53871c

Please sign in to comment.