Fix Google Mail expired authorization (#102735)

* Fix Google Mail expired authorization

* add test

* raise HomeAssistantError

* handle in api module

* uno mas
This commit is contained in:
Robert Hillis 2023-10-30 07:36:34 -04:00 committed by GitHub
parent ba7dbc5927
commit 7dbe0c3a48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 22 deletions

View file

@ -73,8 +73,13 @@ async def test_expired_token_refresh_success(
http.HTTPStatus.INTERNAL_SERVER_ERROR,
ConfigEntryState.SETUP_RETRY,
),
(
time.time() - 3600,
http.HTTPStatus.BAD_REQUEST,
ConfigEntryState.SETUP_ERROR,
),
],
ids=["failure_requires_reauth", "transient_failure"],
ids=["failure_requires_reauth", "transient_failure", "revoked_auth"],
)
async def test_expired_token_refresh_failure(
hass: HomeAssistant,