From d9e7c055e57652ae133f2ac0b0e1e80c46baf859 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 21 Dec 2024 20:40:31 -0600 Subject: [PATCH] Add weather forecasts to tests --- tests/test_endpoints.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index 6175961..14637f7 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -170,6 +170,27 @@ async def test_async_trigger_service(async_cached_client: Client) -> None: ) assert isinstance(resp, tuple) +def test_trigger_service_with_response(cached_client: Client) -> None: + """Tests the `POST /api/services//?return_response` endpoint.""" + weather = cached_client.get_domain("weather") + assert weather is not None + changed_states, data = weather.get_forecasts( + entity_id="weather.forecast_home", + type="hourly", + ) + assert data is not None + + +async def test_async_trigger_service_with_response(async_cached_client: Client) -> None: + """Tests the `POST /api/services//?return_response` endpoint.""" + weather = await async_cached_client.async_get_domain("weather") + assert weather is not None + changed_states, data = await weather.get_forecasts( + entity_id="weather.forecast_home", + type="hourly", + ) + assert data is not None + def test_get_states(cached_client: Client) -> None: """Tests the `GET /api/states` endpoint."""