Skip to content

feat: improve aiohttp client error messages #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 3, 2024
Prev Previous commit
Next Next commit
chore: move asserts out of block
  • Loading branch information
jackwotherspoon committed Dec 3, 2024
commit 7d69fc5f33e53e0c077862733abb3760305a0e3e
14 changes: 7 additions & 7 deletions tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ async def test_cloud_sql_error_messages_get_metadata(
)
with pytest.raises(ClientResponseError) as exc_info:
await client._get_metadata("my-project", "my-region", "my-instance")
assert exc_info.status == 403
assert (
exc_info.message
== "Cloud SQL Admin API has not been used in project 123456789 before or it is disabled"
)
assert exc_info.value.status == 403
assert (
exc_info.value.message
== "Cloud SQL Admin API has not been used in project 123456789 before or it is disabled"
)
await client.close()


Expand Down Expand Up @@ -207,6 +207,6 @@ async def test_cloud_sql_error_messages_get_ephemeral(
)
with pytest.raises(ClientResponseError) as exc_info:
await client._get_ephemeral("my-project", "my-instance", "my-key")
assert exc_info.status == 404
assert exc_info.message == "The Cloud SQL instance does not exist."
assert exc_info.value.status == 404
assert exc_info.value.message == "The Cloud SQL instance does not exist."
await client.close()
Loading