1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Migrate google related tests to use freezegun (#105552)

* Migrate google related tests to use freezegun

* retrigger CI

* Fix google tests

* Add timezone to config_entry_token_expiry

* Separate config_entry_token_expiry from token_expiry

* Also test token refresh for offset-naive tokens

* retrigger CI

* Apply code review suggestion

Co-authored-by: Allen Porter <allen.porter@gmail.com>

* Run ruff-format

---------

Co-authored-by: Allen Porter <allen.porter@gmail.com>
This commit is contained in:
Jan-Philipp Benecke
2023-12-21 12:23:01 +01:00
committed by GitHub
parent f8f31627ce
commit 0ae0331c5c
6 changed files with 40 additions and 31 deletions

View File

@@ -699,7 +699,11 @@ async def test_add_event_location(
@pytest.mark.parametrize(
"config_entry_token_expiry",
[datetime.datetime.max.replace(tzinfo=UTC).timestamp() + 1],
[
(datetime.datetime.max.replace(tzinfo=UTC).timestamp() + 1),
(utcnow().replace(tzinfo=None).timestamp()),
],
ids=["max_timestamp", "timestamp_naive"],
)
async def test_invalid_token_expiry_in_config_entry(
hass: HomeAssistant,