From e71bd2c20b485fbccce9243cfa20191a6d617362 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Sun, 16 Oct 2022 11:45:57 -0700 Subject: [PATCH] Fix google calendar test to match API behavior (#80436) --- tests/components/google/test_calendar.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/components/google/test_calendar.py b/tests/components/google/test_calendar.py index 49bfa8e1d72..778e4a843eb 100644 --- a/tests/components/google/test_calendar.py +++ b/tests/components/google/test_calendar.py @@ -85,15 +85,6 @@ def upcoming() -> dict[str, Any]: } -def upcoming_date() -> dict[str, Any]: - """Create a test event with an arbitrary start/end date fetched from the api url.""" - now = dt_util.now() - return { - "start": {"date": now.date().isoformat()}, - "end": {"date": now.date().isoformat()}, - } - - def upcoming_event_url(entity: str = TEST_ENTITY) -> str: """Return a calendar API to return events created by upcoming().""" now = dt_util.now() @@ -463,7 +454,8 @@ async def test_http_api_all_day_event( """Test querying the API and fetching events from the server.""" event = { **TEST_EVENT, - **upcoming_date(), + "start": {"date": "2022-03-27"}, + "end": {"date": "2022-03-28"}, } mock_events_list_items([event]) assert await component_setup() @@ -476,7 +468,7 @@ async def test_http_api_all_day_event( assert {k: events[0].get(k) for k in ["summary", "start", "end"]} == { "summary": TEST_EVENT["summary"], "start": {"date": "2022-03-27"}, - "end": {"date": "2022-03-27"}, + "end": {"date": "2022-03-28"}, }