mirror of
https://github.com/home-assistant/core.git
synced 2026-05-04 03:51:12 +02:00
Fix google invalid token expiry test init for UTC offsets > 0 (#100533)
```
$ python3 -q
>>> import datetime, time
>>> time.tzname
('EET', 'EEST')
>>> datetime.datetime.max.timestamp()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: year 10000 is out of range
```
This commit is contained in:
@@ -20,7 +20,7 @@ from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.const import ATTR_FRIENDLY_NAME, STATE_OFF
|
||||
from homeassistant.core import HomeAssistant, State
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.util.dt import utcnow
|
||||
from homeassistant.util.dt import UTC, utcnow
|
||||
|
||||
from .conftest import (
|
||||
CALENDAR_ID,
|
||||
@@ -645,7 +645,8 @@ async def test_add_event_location(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"config_entry_token_expiry", [datetime.datetime.max.timestamp() + 1]
|
||||
"config_entry_token_expiry",
|
||||
[datetime.datetime.max.replace(tzinfo=UTC).timestamp() + 1],
|
||||
)
|
||||
async def test_invalid_token_expiry_in_config_entry(
|
||||
hass: HomeAssistant,
|
||||
|
||||
Reference in New Issue
Block a user