hass-core/tests/components/accuweather/__init__.py
Maciej Bieniek 09be56964d
AccuWeather tests refactoring (#116923)
* Add mock_accuweather_client

* Improve tests

* Fix exceptions

* Remove unneeded update_listener()

* Fix arguments for fixtures

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-06 19:41:48 +02:00

26 lines
683 B
Python

"""Tests for AccuWeather."""
from homeassistant.components.accuweather.const import DOMAIN
from tests.common import MockConfigEntry
async def init_integration(hass) -> MockConfigEntry:
"""Set up the AccuWeather integration in Home Assistant."""
entry = MockConfigEntry(
domain=DOMAIN,
title="Home",
unique_id="0123456",
data={
"api_key": "32-character-string-1234567890qw",
"latitude": 55.55,
"longitude": 122.12,
"name": "Home",
},
)
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
return entry