2018-02-03 02:17:01 +00:00
|
|
|
"""The test for the Melissa Climate component."""
|
|
|
|
from homeassistant.components import melissa
|
|
|
|
|
2019-10-23 06:19:00 +00:00
|
|
|
from tests.common import MockDependency, mock_coro_func
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
VALID_CONFIG = {"melissa": {"username": "********", "password": "********"}}
|
2018-02-03 02:17:01 +00:00
|
|
|
|
|
|
|
|
2018-10-30 20:29:11 +00:00
|
|
|
async def test_setup(hass):
|
|
|
|
"""Test setting up the Melissa component."""
|
2019-07-31 19:25:30 +00:00
|
|
|
with MockDependency("melissa") as mocked_melissa:
|
2019-10-23 06:19:00 +00:00
|
|
|
melissa.melissa = mocked_melissa
|
2018-10-30 20:29:11 +00:00
|
|
|
mocked_melissa.AsyncMelissa().async_connect = mock_coro_func()
|
|
|
|
await melissa.async_setup(hass, VALID_CONFIG)
|
2018-02-03 02:17:01 +00:00
|
|
|
|
2018-10-30 20:29:11 +00:00
|
|
|
mocked_melissa.AsyncMelissa.assert_called_with(
|
2019-07-31 19:25:30 +00:00
|
|
|
username="********", password="********"
|
|
|
|
)
|
2018-10-30 20:29:11 +00:00
|
|
|
|
|
|
|
assert melissa.DATA_MELISSA in hass.data
|
2019-07-31 19:25:30 +00:00
|
|
|
assert isinstance(
|
|
|
|
hass.data[melissa.DATA_MELISSA], type(mocked_melissa.AsyncMelissa())
|
|
|
|
)
|