Fix typos found by codespell (#31243)

* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
This commit is contained in:
Christian Clauss authored and GitHub committed 2020-01-31 08:33:00 -08:00
1 parent a017c26234
commit df7d2b3aeb
121 files changed
+170 -156

No files matched your search

+1 -1
View File
@@ -321,7 +321,7 @@ async def test_include_exclude_config(hass):
async def test_setup_user_no_notify_service(hass):
"""Test setup flow abort if there is no avilable notify service."""
"""Test setup flow abort if there is no available notify service."""
async_mock_service(hass, "notify", "test1", NOTIFY_SERVICE_SCHEMA)
notify_auth_module = await auth_mfa_module_from_config(
hass, {"type": "notify", "exclude": "test1"}
+1 -1
View File
@@ -453,7 +453,7 @@ async def test_refresh_token_type_long_lived_access_token(hass):
async def test_cannot_deactive_owner(mock_hass):
"""Test that we cannot deactive the owner."""
"""Test that we cannot deactivate the owner."""
manager = await auth.auth_manager_from_config(mock_hass, [], [])
owner = MockUser(is_owner=True).add_to_auth_manager(manager)
+2 -2
View File
@@ -541,7 +541,7 @@ async def test_rendering_template_legacy_user(
async def test_api_call_service_not_found(hass, mock_api_client):
"""Test if the API failes 400 if unknown service."""
"""Test if the API fails 400 if unknown service."""
resp = await mock_api_client.post(
const.URL_API_SERVICES_SERVICE.format("test_domain", "test_service")
)
@@ -549,7 +549,7 @@ async def test_api_call_service_not_found(hass, mock_api_client):
async def test_api_call_service_bad_data(hass, mock_api_client):
"""Test if the API failes 400 if unknown service."""
"""Test if the API fails 400 if unknown service."""
test_value = []
@ha.callback
+2 -2
View File
@@ -95,7 +95,7 @@ async def test_apprise_notification(hass):
assert await async_setup_component(hass, BASE_COMPONENT, config)
await hass.async_block_till_done()
# Test the existance of our service
# Test the existence of our service
assert hass.services.has_service(BASE_COMPONENT, "test")
# Test the call to our underlining notify() call
@@ -134,7 +134,7 @@ async def test_apprise_notification_with_target(hass, tmp_path):
assert await async_setup_component(hass, BASE_COMPONENT, config)
await hass.async_block_till_done()
# Test the existance of our service
# Test the existence of our service
assert hass.services.has_service(BASE_COMPONENT, "test")
# Test the call to our underlining notify() call
@@ -123,7 +123,7 @@ async def test_turn_off(player, state):
@pytest.mark.parametrize("mute", [True, False])
async def test_mute_volume(player, state, mute):
"""Test mute functionallity."""
"""Test mute functionality."""
await player.async_mute_volume(mute)
state.set_mute.assert_called_with(mute)
player.async_schedule_update_ha_state.assert_called_with()
@@ -200,14 +200,14 @@ async def test_select_sound_mode(player, state, mode, mode_sel, mode_2ch, mode_m
async def test_volume_up(player, state):
"""Test mute functionallity."""
"""Test mute functionality."""
await player.async_volume_up()
state.inc_volume.assert_called_with()
player.async_schedule_update_ha_state.assert_called_with()
async def test_volume_down(player, state):
"""Test mute functionallity."""
"""Test mute functionality."""
await player.async_volume_down()
state.dec_volume.assert_called_with()
player.async_schedule_update_ha_state.assert_called_with()
@@ -149,7 +149,7 @@ class TestBayesianBinarySensor(unittest.TestCase):
assert state.state == "off"
def test_threshold(self):
"""Test sensor on probabilty threshold limits."""
"""Test sensor on probability threshold limits."""
config = {
"binary_sensor": {
"name": "Test_Binary",
@@ -19,7 +19,7 @@ HOST = "example.com"
@pytest.fixture(name="test_connect")
def mock_controller():
"""Mock a successfull _prt_in_configuration_exists."""
"""Mock a successful _prt_in_configuration_exists."""
with patch(
"homeassistant.components.cert_expiry.config_flow.CertexpiryConfigFlow._test_connection",
side_effect=lambda *_: mock_coro(True),
+1 -1
View File
@@ -217,7 +217,7 @@ async def test_google_config_should_2fa(hass, mock_cloud_setup, mock_cloud_login
async def test_set_username(hass):
"""Test we set username during loggin."""
"""Test we set username during login."""
prefs = MagicMock(
alexa_enabled=False,
google_enabled=False,
+3 -3
View File
@@ -480,7 +480,7 @@ async def test_set_protection_value_failed(hass, client):
resp = await client.post(
"/api/zwave/protection/18",
data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}),
data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}),
)
assert resp.status == 202
@@ -512,7 +512,7 @@ async def test_set_protection_value_nonexisting_node(hass, client):
resp = await client.post(
"/api/zwave/protection/18",
data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}),
data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}),
)
assert resp.status == 404
@@ -532,7 +532,7 @@ async def test_set_protection_value_missing_class(hass, client):
resp = await client.post(
"/api/zwave/protection/17",
data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}),
data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}),
)
assert resp.status == 404
+1 -1
View File
@@ -30,7 +30,7 @@ INVALID_CONFIG_MINIMAL = {
"api_key": "foo",
"forecast": [1, 2],
"hourly_forecast": [1, 2],
"monitored_conditions": ["sumary", "iocn", "temperature_high"],
"monitored_conditions": ["summary", "iocn", "temperature_high"],
"scan_interval": timedelta(seconds=120),
}
}
@@ -610,7 +610,7 @@ async def test_close_cover(hass_hue, hue_client):
async def test_set_position_cover(hass_hue, hue_client):
"""Test setting postion cover ."""
"""Test setting position cover ."""
COVER_ID = "cover.living_room_window"
# Turn the office light off first
await hass_hue.services.async_call(
+1 -1
View File
@@ -88,7 +88,7 @@ class TestFacebook(unittest.TestCase):
"""Test sending a message without a target."""
mock.register_uri(requests_mock.POST, facebook.BASE_URL, status_code=200)
self.facebook.send_message(message="goin nowhere")
self.facebook.send_message(message="going nowhere")
assert not mock.called
@requests_mock.Mocker()
+1 -1
View File
@@ -91,7 +91,7 @@ class TestFritzboxClimate(unittest.TestCase):
@patch.object(FritzboxThermostat, "set_hvac_mode")
def test_set_temperature_operation_mode_precedence(self, mock_set_op):
"""Test set_temperature for precedence of operation_mode arguement."""
"""Test set_temperature for precedence of operation_mode argument."""
self.thermostat.set_temperature(hvac_mode="heat", temperature=23.0)
mock_set_op.assert_called_once_with("heat")
self.thermostat._device.set_target_temperature.assert_not_called()
+1 -1
View File
@@ -506,7 +506,7 @@ async def test_select_radio_favorite(hass, config_entry, config, controller, fav
async def test_select_radio_favorite_command_error(
hass, config_entry, config, controller, favorites, caplog
):
"""Tests command error loged when playing favorite."""
"""Tests command error logged when playing favorite."""
await setup_platform(hass, config_entry, config)
player = controller.players[1]
# Test set radio preset
+1 -1
View File
@@ -246,7 +246,7 @@ async def test_linked_battery_sensor(hass, hk_driver, caplog):
async def test_missing_linked_battery_sensor(hass, hk_driver, caplog):
"""Test battery service with mising linked_battery_sensor."""
"""Test battery service with missing linked_battery_sensor."""
entity_id = "homekit.accessory"
linked_battery = "sensor.battery"
hass.states.async_set(entity_id, "open")
@@ -16,7 +16,7 @@ def create_security_system_service():
targ_state.value = 0
# According to the spec, a battery-level characteristic is normally
# part of a seperate service. However as the code was written (which
# part of a separate service. However as the code was written (which
# predates this test) the battery level would have to be part of the lock
# service as it is here.
targ_state = service.add_characteristic("battery-level")
@@ -16,7 +16,7 @@ def create_lock_service():
targ_state.value = 0
# According to the spec, a battery-level characteristic is normally
# part of a seperate service. However as the code was written (which
# part of a separate service. However as the code was written (which
# predates this test) the battery level would have to be part of the lock
# service as it is here.
targ_state = service.add_characteristic("battery-level")
+1 -1
View File
@@ -215,7 +215,7 @@ async def test_flow_link_timeout(hass):
async def test_flow_link_unknown_error(hass):
"""Test if a unknown error happend during the linking processes."""
"""Test if a unknown error happened during the linking processes."""
mock_bridge = get_mock_bridge(mock_create_user=CoroutineMock(side_effect=OSError),)
with patch(
"homeassistant.components.hue.config_flow.discover_nupnp",
+1 -1
View File
@@ -307,7 +307,7 @@ async def test_restore_state(hass):
async def test_default_value(hass):
"""Test default value if none has been set via inital or restore state."""
"""Test default value if none has been set via initial or restore state."""
await async_setup_component(
hass,
DOMAIN,
@@ -179,7 +179,7 @@ async def test_name_exists(hass, api):
async def test_connection_error(hass, conn_error):
"""Test error when connection is unsuccesful."""
"""Test error when connection is unsuccessful."""
result = await hass.config_entries.flow.async_init(
mikrotik.DOMAIN, context={"source": "user"}
+1 -1
View File
@@ -16,7 +16,7 @@ async def test_setup_with_no_config(hass):
async def test_successful_config_entry(hass):
"""Test config entry successfull setup."""
"""Test config entry successful setup."""
entry = MockConfigEntry(domain=mikrotik.DOMAIN, data=MOCK_DATA,)
entry.add_to_hass(hass)
mock_registry = Mock()
+1 -1
View File
@@ -50,7 +50,7 @@ async def test_user_connection_works(hass, mock_try_connection, mock_finish_setu
async def test_user_connection_fails(hass, mock_try_connection, mock_finish_setup):
"""Test if connnection cannot be made."""
"""Test if connection cannot be made."""
mock_try_connection.return_value = False
result = await hass.config_entries.flow.async_init(
+1 -1
View File
@@ -229,7 +229,7 @@ async def test_discovery_expansion(hass, mqtt_mock, caplog):
' "name":"DiscoveryExpansionTest1 Device",'
' "mdl":"Generic",'
' "sw":"1.2.3.4",'
' "mf":"Noone"'
' "mf":"None"'
" }"
"}"
)
+1 -1
View File
@@ -7,7 +7,7 @@ from tests.common import load_fixture
async def test_entity_registry(hass, requests_mock):
"""Tests that the devices are registed in the entity registry."""
"""Tests that the devices are registered in the entity registry."""
await setup_platform(hass, LIGHT_DOMAIN)
entity_registry = await hass.helpers.entity_registry.async_get_registry()
+1 -1
View File
@@ -7,7 +7,7 @@ from tests.common import load_fixture
async def test_entity_registry(hass, requests_mock):
"""Tests that the devices are registed in the entity registry."""
"""Tests that the devices are registered in the entity registry."""
await setup_platform(hass, SWITCH_DOMAIN)
entity_registry = await hass.helpers.entity_registry.async_get_registry()
+1 -1
View File
@@ -75,7 +75,7 @@ async def test_setup_hass(hass: HomeAssistant, aioclient_mock) -> None:
async def test_setup_plattform(hass):
"""Test that setup plattform does nothing."""
"""Test that setup platform does nothing."""
assert await weather_smhi.async_setup_platform(hass, None, None) is None
@@ -18,7 +18,7 @@ API_KEY = "a1b2c3d4e5f6g7h8"
@pytest.fixture(name="test_api")
def mock_controller():
"""Mock a successfull Solaredge API."""
"""Mock a successful Solaredge API."""
api = Mock()
api.get_details.return_value = {"details": {"status": "active"}}
with patch("solaredge.Solaredge", return_value=api):
@@ -46,7 +46,7 @@ async def test_form(hass):
@pytest.fixture(name="test_connect")
def mock_controller():
"""Mock a successfull _host_in_configuration_exists."""
"""Mock a successful _host_in_configuration_exists."""
with patch(
"homeassistant.components.solarlog.config_flow.SolarLogConfigFlow._test_connection",
side_effect=lambda *_: mock_coro(True),
+2 -2
View File
@@ -47,7 +47,7 @@ async def test_hls_stream(hass, hass_client):
# Stop stream, if it hasn't quit already
stream.stop()
# Ensure playlist not accessable after stream ends
# Ensure playlist not accessible after stream ends
fail_response = await http_client.get(parsed_url.path)
assert fail_response.status == 404
@@ -84,7 +84,7 @@ async def test_stream_timeout(hass, hass_client):
future = dt_util.utcnow() + timedelta(minutes=5)
async_fire_time_changed(hass, future)
# Ensure playlist not accessable
# Ensure playlist not accessible
fail_response = await http_client.get(parsed_url.path)
assert fail_response.status == 404
@@ -239,7 +239,7 @@ async def test_abort_if_exception_generating_auth_url(hass, mock_tellduslive):
async def test_discovery_already_configured(hass, mock_tellduslive):
"""Test abort if alredy configured fires from discovery."""
"""Test abort if already configured fires from discovery."""
MockConfigEntry(domain="tellduslive", data={"host": "some-host"}).add_to_hass(hass)
flow = init_config_flow(hass)
+1 -1
View File
@@ -885,7 +885,7 @@ async def test_availability_template(hass, calls):
async def test_availability_without_availability_template(hass, calls):
"""Test that component is availble if there is no."""
"""Test that component is available if there is no."""
assert await setup.async_setup_component(
hass,
"cover",
+1 -1
View File
@@ -24,7 +24,7 @@ class TestBinarySensorTod(unittest.TestCase):
def setup_method(self, method):
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.hass.config.latitute = 50.27583
self.hass.config.latitude = 50.27583
self.hass.config.longitude = 18.98583
def teardown_method(self, method):
+1 -1
View File
@@ -307,7 +307,7 @@ async def test_get_controller_controller_unavailable(hass):
async def test_get_controller_unknown_error(hass):
"""Check that get_controller can handle unkown errors."""
"""Check that get_controller can handle unknown errors."""
with patch(
"aiounifi.Controller.login", side_effect=aiounifi.AiounifiException
), pytest.raises(unifi.errors.AuthenticationRequired):
@@ -269,7 +269,7 @@ async def test_restoring_client(hass):
async def test_dont_track_clients(hass):
"""Test dont track clients config works."""
"""Test don't track clients config works."""
await setup_unifi_integration(
hass,
options={unifi.controller.CONF_TRACK_CLIENTS: False},
@@ -287,7 +287,7 @@ async def test_dont_track_clients(hass):
async def test_dont_track_devices(hass):
"""Test dont track devices config works."""
"""Test don't track devices config works."""
await setup_unifi_integration(
hass,
options={unifi.controller.CONF_TRACK_DEVICES: False},
@@ -305,7 +305,7 @@ async def test_dont_track_devices(hass):
async def test_dont_track_wired_clients(hass):
"""Test dont track wired clients config works."""
"""Test don't track wired clients config works."""
await setup_unifi_integration(
hass,
options={unifi.controller.CONF_TRACK_WIRED_CLIENTS: False},
+1 -1
View File
@@ -22,7 +22,7 @@ def mock_controller_assert():
@pytest.fixture(name="controller")
def mock_controller():
"""Mock a successfull velbus controller."""
"""Mock a successful velbus controller."""
controller = Mock()
with patch("velbus.Controller", return_value=controller):
yield controller
+1 -1
View File
@@ -72,7 +72,7 @@ def vizio_guess_device_type_fixture():
@pytest.fixture(name="vizio_cant_connect")
def vizio_cant_connect_fixture():
"""Mock vizio device cant connect."""
"""Mock vizio device can't connect."""
with patch(
"homeassistant.components.vizio.config_flow.VizioAsync.validate_ha_config",
return_value=False,
+1 -1
View File
@@ -316,7 +316,7 @@ async def test_zeroconf_flow(
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["step_id"] == "user"
# Apply discovery updates to entry to mimick when user hits submit without changing
# Apply discovery updates to entry to mimic when user hits submit without changing
# defaults which were set from discovery parameters
user_input = result["data_schema"](discovery_info)
+1 -1
View File
@@ -36,7 +36,7 @@ def init_valid_settings(hass, config):
@pytest.fixture(name="invalid_provider_settings")
def init_invalid_provider_settings(hass, config):
"""Set invalid provider data and initalize component."""
"""Set invalid provider data and initialize component."""
config["notify"][CONF_PROVIDER] = "FantasyMobile" # invalid provider
return async_setup_component(hass, "notify", config)
+1 -1
View File
@@ -110,7 +110,7 @@ async def async_build_devices(hass, zha_gateway, config_entry, cluster_ids):
This will build devices for all cluster ids that exist in cluster_ids.
They get added to the network and then the sensor component is loaded
which will cause sensor entites to get created for each device.
which will cause sensor entities to get created for each device.
A dict containing relevant device info for testing is returned. It contains
the entity id, zigpy device, and the zigbee cluster for the sensor.
"""
+1 -1
View File
@@ -342,7 +342,7 @@ def test_get_device_detects_single_setpoint_device(device_single_setpoint):
def test_default_hvac_modes():
"""Test wether all hvac modes are included in default_hvac_modes."""
"""Test whether all hvac modes are included in default_hvac_modes."""
for hvac_mode in HVAC_MODES:
assert hvac_mode in DEFAULT_HVAC_MODES
+1 -1
View File
@@ -100,7 +100,7 @@ async def test_network_key_validation(hass, mock_openzwave):
async def test_erronous_network_key_fails_validation(hass, mock_openzwave):
"""Test failing erronous network key validation."""
"""Test failing erroneous network key validation."""
test_values = [
(
"0x 01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, "
+2 -2
View File
@@ -263,7 +263,7 @@ async def test_extract_from_service_no_group_expand(hass):
async def test_setup_dependencies_platform(hass):
"""Test we setup the dependencies of a platform.
We're explictely testing that we process dependencies even if a component
We're explicitly testing that we process dependencies even if a component
with the same name has already been loaded.
"""
mock_integration(
@@ -305,7 +305,7 @@ async def test_setup_entry(hass):
async def test_setup_entry_platform_not_exist(hass):
"""Test setup entry fails if platform doesnt exist."""
"""Test setup entry fails if platform does not exist."""
component = EntityComponent(_LOGGER, DOMAIN, hass)
entry = MockConfigEntry(domain="non_existing")
+2 -2
View File
@@ -394,7 +394,7 @@ async def test_using_prescribed_entity_id(hass):
async def test_using_prescribed_entity_id_with_unique_id(hass):
"""Test for ammending predefined entity ID because currently exists."""
"""Test for amending predefined entity ID because currently exists."""
component = EntityComponent(_LOGGER, DOMAIN, hass)
await component.async_add_entities([MockEntity(entity_id="test_domain.world")])
@@ -839,7 +839,7 @@ async def test_override_restored_entities(hass):
async def test_platform_with_no_setup(hass, caplog):
"""Test setting up a platform that doesnt' support setup."""
"""Test setting up a platform that does not support setup."""
entity_platform = MockEntityPlatform(
hass, domain="mock-integration", platform_name="mock-platform", platform=None
)
+3 -3
View File
@@ -475,7 +475,7 @@ async def test_track_sunrise_update_location(hass):
with patch("homeassistant.util.dt.utcnow", return_value=utc_now):
async_track_sunrise(hass, lambda: runs.append(1))
# Mimick sunrise
# Mimic sunrise
_send_time_changed(hass, next_rising)
await hass.async_block_till_done()
assert len(runs) == 1
@@ -485,7 +485,7 @@ async def test_track_sunrise_update_location(hass):
await hass.config.async_update(latitude=40.755931, longitude=-73.984606)
await hass.async_block_till_done()
# Mimick sunrise
# Mimic sunrise
_send_time_changed(hass, next_rising)
await hass.async_block_till_done()
# Did not increase
@@ -501,7 +501,7 @@ async def test_track_sunrise_update_location(hass):
break
mod += 1
# Mimick sunrise at new location
# Mimic sunrise at new location
_send_time_changed(hass, next_rising)
await hass.async_block_till_done()
assert len(runs) == 2
+2 -2
View File
@@ -348,7 +348,7 @@ async def test_call_context_user_not_exist(hass):
async def test_call_context_target_all(hass, mock_service_platform_call, mock_entities):
"""Check we only target allowed entities if targetting all."""
"""Check we only target allowed entities if targeting all."""
with patch(
"homeassistant.auth.AuthManager.async_get_user",
return_value=mock_coro(
@@ -473,7 +473,7 @@ async def test_call_no_context_target_specific(
async def test_call_with_match_all(
hass, mock_service_platform_call, mock_entities, caplog
):
"""Check we only target allowed entities if targetting all."""
"""Check we only target allowed entities if targeting all."""
await service.entity_service_call(
hass,
[Mock(entities=mock_entities)],
+1 -1
View File
@@ -576,7 +576,7 @@ async def test_merge(merge_log_err, hass):
async def test_merge_try_falsy(merge_log_err, hass):
"""Ensure we dont add falsy items like empty OrderedDict() to list."""
"""Ensure we don't add falsy items like empty OrderedDict() to list."""
packages = {
"pack_falsy_to_lst": {"automation": OrderedDict()},
"pack_list2": {"light": OrderedDict()},