Fix google calendar test to match API behavior (#80436)

This commit is contained in:
Allen Porter 2022-10-16 11:45:57 -07:00 committed by GitHub
parent a7f33535c7
commit e71bd2c20b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"},
}