Skip to content

Commit

Permalink
tests: fix mock response body serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
orndorffgrant committed Jul 27, 2023
1 parent 7360322 commit f64181d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion uaclient/http/serviceclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _get_fake_responses(self, url: str) -> Optional[http.HTTPResponse]:
return http.HTTPResponse(
code=response["code"],
headers=response.get("headers", {}),
body=str(response["response"]),
body=json.dumps(response["response"], sort_keys=True),
json_dict=json_dict,
json_list=json_list,
)
2 changes: 1 addition & 1 deletion uaclient/http/tests/test_serviceclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_overlay_returns_matching_url(
assert http.HTTPResponse(
code=response["code"],
headers=response.get("headers", {}),
body=str(response["response"]),
body=json.dumps(response["response"], sort_keys=True),
json_dict=response["response"]
if isinstance(response["response"], dict)
else {},
Expand Down

0 comments on commit f64181d

Please sign in to comment.