Skip to content

Commit

Permalink
Fix failing google diagnostics test (#113095)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored and frenck committed Mar 14, 2024
1 parent eb04365 commit cda9bf7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/components/google/test_diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for diagnostics platform of google calendar."""
from collections.abc import Callable
import time
from typing import Any

from aiohttp.test_utils import TestClient
Expand All @@ -15,6 +16,7 @@

from tests.common import CLIENT_ID, MockConfigEntry, MockUser
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.test_util.aiohttp import AiohttpClientMocker
from tests.typing import ClientSessionGenerator


Expand Down Expand Up @@ -69,8 +71,21 @@ async def test_diagnostics(
aiohttp_client: ClientSessionGenerator,
socket_enabled: None,
snapshot: SnapshotAssertion,
aioclient_mock: AiohttpClientMocker,
) -> None:
"""Test diagnostics for the calendar."""

expires_in = 86400
expires_at = time.time() + expires_in
aioclient_mock.post(
"https://oauth2.googleapis.com/token",
json={
"refresh_token": "some-refresh-token",
"access_token": "some-updated-token",
"expires_at": expires_at,
"expires_in": expires_in,
},
)
mock_events_list_items(
[
{
Expand Down

0 comments on commit cda9bf7

Please sign in to comment.