Skip to content

Commit

Permalink
Add weather forecasts to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandMoff100 committed Dec 22, 2024
1 parent 3d8850f commit d9e7c05
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<domain>/<service>?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/<domain>/<service>?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."""
Expand Down

0 comments on commit d9e7c05

Please sign in to comment.