mirror of
https://github.com/home-assistant/core.git
synced 2025-04-27 02:37:50 +00:00
Fix google calendar test to match API behavior (#80436)
This commit is contained in:
parent
a7f33535c7
commit
e71bd2c20b
@ -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"},
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user