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:
1 parent
a017c26234
commit
df7d2b3aeb
121 files changed
+170
-156
No files matched your search
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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"}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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"'
|
||||
" }"
|
||||
"}"
|
||||
)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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.
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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, "
|
||||
|
||||
Reference in new issue
Block a user