hass-core/tests/components/test_melissa.py
kennedyshead f7c9787418 Add Melissa (HVAC/climate) component (#11503)
* Adding component melissa

* Adding sensor component melissa

* Adding Melissa climate component

* Testing component

* Tests for Climate component

* Testing Melissa sensor

* Fixing review Thank you @rytilahti
2018-02-03 03:17:01 +01:00

38 lines
1.1 KiB
Python

"""The test for the Melissa Climate component."""
import unittest
from tests.common import get_test_home_assistant, MockDependency
from homeassistant.components import melissa
VALID_CONFIG = {
"melissa": {
"username": "********",
"password": "********",
}
}
class TestMelissa(unittest.TestCase):
"""Test the Melissa component."""
def setUp(self): # pylint: disable=invalid-name
"""Initialize the values for this test class."""
self.hass = get_test_home_assistant()
self.config = VALID_CONFIG
def tearDown(self): # pylint: disable=invalid-name
"""Teardown this test class. Stop hass."""
self.hass.stop()
@MockDependency("melissa")
def test_setup(self, mocked_melissa):
"""Test setting up the Melissa component."""
melissa.setup(self.hass, self.config)
mocked_melissa.Melissa.assert_called_with(
username="********", password="********")
self.assertIn(melissa.DATA_MELISSA, self.hass.data)
self.assertIsInstance(
self.hass.data[melissa.DATA_MELISSA], type(
mocked_melissa.Melissa())
)