Move components to folders (#20774)
* Move all components into folders * Move component tests into folders * Fix init moving * Move tests * Lint * Update coverage * Fix service descriptions * Update CODEOWNERS
This commit is contained in:
1 parent
d13b2ca6ef
commit
b8cc547fa3
275 files changed
+512
-684
No files matched your search
@@ -0,0 +1,45 @@
|
||||
"""The tests for the litejet component."""
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
from homeassistant.components import litejet
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TestLiteJet(unittest.TestCase):
|
||||
"""Test the litejet component."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.start()
|
||||
self.hass.block_till_done()
|
||||
|
||||
def teardown_method(self, method):
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_is_ignored_unspecified(self):
|
||||
"""Ensure it is ignored when unspecified."""
|
||||
self.hass.data['litejet_config'] = {}
|
||||
assert not litejet.is_ignored(self.hass, 'Test')
|
||||
|
||||
def test_is_ignored_empty(self):
|
||||
"""Ensure it is ignored when empty."""
|
||||
self.hass.data['litejet_config'] = {
|
||||
litejet.CONF_EXCLUDE_NAMES: []
|
||||
}
|
||||
assert not litejet.is_ignored(self.hass, 'Test')
|
||||
|
||||
def test_is_ignored_normal(self):
|
||||
"""Test if usually ignored."""
|
||||
self.hass.data['litejet_config'] = {
|
||||
litejet.CONF_EXCLUDE_NAMES: ['Test', 'Other One']
|
||||
}
|
||||
assert litejet.is_ignored(self.hass, 'Test')
|
||||
assert not litejet.is_ignored(self.hass, 'Other one')
|
||||
assert not litejet.is_ignored(self.hass, 'Other 0ne')
|
||||
assert litejet.is_ignored(self.hass, 'Other One There')
|
||||
assert litejet.is_ignored(self.hass, 'Other One')
|
||||
Reference in new issue
Block a user