Grammar and spelling fixes (#16065)
This commit is contained in:
1 parent
9e1fa7ef42
commit
dbd0763f83
244 files changed
+453
-453
No files matched your search
@@ -30,7 +30,7 @@ class TestHelpersAiohttpClient(unittest.TestCase):
|
||||
"""Test homeassistant.helpers.aiohttp_client module."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def teardown_method(self, method):
|
||||
|
||||
@@ -11,7 +11,7 @@ class TestConditionHelper:
|
||||
"""Test condition helpers."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def teardown_method(self, method):
|
||||
|
||||
@@ -49,7 +49,7 @@ async def test_user_no_devices_found(hass, flow_conf):
|
||||
|
||||
|
||||
async def test_user_no_confirmation(hass, flow_conf):
|
||||
"""Test user requires no confirmation to setup."""
|
||||
"""Test user requires no confirmation to set up."""
|
||||
flow = config_entries.HANDLERS['test']()
|
||||
flow.hass = hass
|
||||
flow_conf['discovered'] = True
|
||||
@@ -118,7 +118,7 @@ async def test_user_init_trumps_discovery(hass, flow_conf):
|
||||
|
||||
|
||||
async def test_import_no_confirmation(hass, flow_conf):
|
||||
"""Test import requires no confirmation to setup."""
|
||||
"""Test import requires no confirmation to set up."""
|
||||
flow = config_entries.HANDLERS['test']()
|
||||
flow.hass = hass
|
||||
flow_conf['discovered'] = True
|
||||
|
||||
@@ -16,7 +16,7 @@ class TestHelpersDiscovery:
|
||||
"""Tests for discovery helper methods."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def teardown_method(self, method):
|
||||
@@ -117,7 +117,7 @@ class TestHelpersDiscovery:
|
||||
platform_calls = []
|
||||
|
||||
def component_setup(hass, config):
|
||||
"""Setup mock component."""
|
||||
"""Set up mock component."""
|
||||
discovery.load_platform(hass, 'switch', 'test_circular', 'disc',
|
||||
config)
|
||||
component_calls.append(1)
|
||||
@@ -125,7 +125,7 @@ class TestHelpersDiscovery:
|
||||
|
||||
def setup_platform(hass, config, add_devices_callback,
|
||||
discovery_info=None):
|
||||
"""Setup mock platform."""
|
||||
"""Set up mock platform."""
|
||||
platform_calls.append('disc' if discovery_info else 'component')
|
||||
|
||||
loader.set_component(
|
||||
@@ -158,21 +158,21 @@ class TestHelpersDiscovery:
|
||||
def test_1st_discovers_2nd_component(self, mock_signal):
|
||||
"""Test that we don't break if one component discovers the other.
|
||||
|
||||
If the first component fires a discovery event to setup the
|
||||
second component while the second component is about to be setup,
|
||||
it should not setup the second component twice.
|
||||
If the first component fires a discovery event to set up the
|
||||
second component while the second component is about to be set up,
|
||||
it should not set up the second component twice.
|
||||
"""
|
||||
component_calls = []
|
||||
|
||||
def component1_setup(hass, config):
|
||||
"""Setup mock component."""
|
||||
"""Set up mock component."""
|
||||
print('component1 setup')
|
||||
discovery.discover(hass, 'test_component2',
|
||||
component='test_component2')
|
||||
return True
|
||||
|
||||
def component2_setup(hass, config):
|
||||
"""Setup mock component."""
|
||||
"""Set up mock component."""
|
||||
component_calls.append(1)
|
||||
return True
|
||||
|
||||
@@ -186,7 +186,7 @@ class TestHelpersDiscovery:
|
||||
|
||||
@callback
|
||||
def do_setup():
|
||||
"""Setup 2 components."""
|
||||
"""Set up 2 components."""
|
||||
self.hass.async_add_job(setup.async_setup_component(
|
||||
self.hass, 'test_component1', {}))
|
||||
self.hass.async_add_job(setup.async_setup_component(
|
||||
|
||||
@@ -12,7 +12,7 @@ class TestHelpersDispatcher:
|
||||
"""Tests for discovery helper methods."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def teardown_method(self, method):
|
||||
|
||||
@@ -75,7 +75,7 @@ class TestHelpersEntity:
|
||||
"""Test homeassistant.helpers.entity module."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.entity = entity.Entity()
|
||||
self.entity.entity_id = 'test.overwrite_hidden_true'
|
||||
self.hass = self.entity.hass = get_test_home_assistant()
|
||||
|
||||
@@ -39,7 +39,7 @@ class TestHelpersEntityComponent(unittest.TestCase):
|
||||
self.hass.stop()
|
||||
|
||||
def test_setting_up_group(self):
|
||||
"""Setup the setting of a group."""
|
||||
"""Set up the setting of a group."""
|
||||
setup_component(self.hass, 'group', {'group': {}})
|
||||
component = EntityComponent(_LOGGER, DOMAIN, self.hass,
|
||||
group_name='everyone')
|
||||
|
||||
@@ -37,7 +37,7 @@ class TestEventHelpers(unittest.TestCase):
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
@@ -7,15 +7,15 @@ from homeassistant.helpers import location
|
||||
|
||||
|
||||
class TestHelpersLocation(unittest.TestCase):
|
||||
"""Setup the tests."""
|
||||
"""Set up the tests."""
|
||||
|
||||
def test_has_location_with_invalid_states(self):
|
||||
"""Setup the tests."""
|
||||
"""Set up the tests."""
|
||||
for state in (None, 1, "hello", object):
|
||||
self.assertFalse(location.has_location(state))
|
||||
|
||||
def test_has_location_with_states_with_invalid_locations(self):
|
||||
"""Setup the tests."""
|
||||
"""Set up the tests."""
|
||||
state = State('hello.world', 'invalid', {
|
||||
ATTR_LATITUDE: 'no number',
|
||||
ATTR_LONGITUDE: 123.12
|
||||
@@ -23,7 +23,7 @@ class TestHelpersLocation(unittest.TestCase):
|
||||
self.assertFalse(location.has_location(state))
|
||||
|
||||
def test_has_location_with_states_with_valid_location(self):
|
||||
"""Setup the tests."""
|
||||
"""Set up the tests."""
|
||||
state = State('hello.world', 'invalid', {
|
||||
ATTR_LATITUDE: 123.12,
|
||||
ATTR_LONGITUDE: 123.12
|
||||
@@ -31,7 +31,7 @@ class TestHelpersLocation(unittest.TestCase):
|
||||
self.assertTrue(location.has_location(state))
|
||||
|
||||
def test_closest_with_no_states_with_location(self):
|
||||
"""Setup the tests."""
|
||||
"""Set up the tests."""
|
||||
state = State('light.test', 'on')
|
||||
state2 = State('light.test', 'on', {
|
||||
ATTR_LATITUDE: 'invalid',
|
||||
|
||||
@@ -21,7 +21,7 @@ class TestScriptHelper(unittest.TestCase):
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
@@ -19,7 +19,7 @@ class TestServiceHelpers(unittest.TestCase):
|
||||
"""Test the Home Assistant service helpers."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.calls = mock_service(self.hass, 'test_domain', 'test_service')
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class TestSun(unittest.TestCase):
|
||||
"""Test the sun helpers."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self):
|
||||
|
||||
@@ -13,10 +13,10 @@ TEMP = 24.636626
|
||||
|
||||
|
||||
class TestHelpersTemperature(unittest.TestCase):
|
||||
"""Setup the temperature tests."""
|
||||
"""Set up the temperature tests."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup the tests."""
|
||||
"""Set up the tests."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.unit_system = METRIC_SYSTEM
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestHelpersTemplate(unittest.TestCase):
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
def setUp(self):
|
||||
"""Setup the tests."""
|
||||
"""Set up the tests."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.units = UnitSystem('custom', TEMP_CELSIUS,
|
||||
LENGTH_METERS, VOLUME_LITERS,
|
||||
|
||||
Reference in new issue
Block a user