Fix typos in UptimeRobot tests (#143397)

This commit is contained in:
Simone Chemelli 2025-04-21 14:11:51 +02:00 committed by GitHub
parent 8fa48a9781
commit 7ea8827e69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 16 deletions

View File

@ -41,9 +41,7 @@ rules:
log-when-unavailable: done log-when-unavailable: done
parallel-updates: done parallel-updates: done
reauthentication-flow: done reauthentication-flow: done
test-coverage: test-coverage: done
status: todo
comment: recheck typos
# Gold # Gold
devices: done devices: done

View File

@ -34,8 +34,8 @@ async def test_presentation(hass: HomeAssistant) -> None:
assert entity.attributes["target"] == MOCK_UPTIMEROBOT_MONITOR["url"] assert entity.attributes["target"] == MOCK_UPTIMEROBOT_MONITOR["url"]
async def test_unaviable_on_update_failure(hass: HomeAssistant) -> None: async def test_unavailable_on_update_failure(hass: HomeAssistant) -> None:
"""Test entity unaviable on update failure.""" """Test entity unavailable on update failure."""
await setup_uptimerobot_integration(hass) await setup_uptimerobot_integration(hass)
entity = hass.states.get(UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY) entity = hass.states.get(UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY)

View File

@ -24,8 +24,8 @@ from .common import (
from tests.common import MockConfigEntry from tests.common import MockConfigEntry
async def test_form(hass: HomeAssistant) -> None: async def test_user(hass: HomeAssistant) -> None:
"""Test we get the form.""" """Test user flow."""
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER} DOMAIN, context={"source": config_entries.SOURCE_USER}
@ -56,8 +56,8 @@ async def test_form(hass: HomeAssistant) -> None:
assert len(mock_setup_entry.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1
async def test_form_read_only(hass: HomeAssistant) -> None: async def test_user_key_read_only(hass: HomeAssistant) -> None:
"""Test we get the form.""" """Test user flow with read only key."""
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER} DOMAIN, context={"source": config_entries.SOURCE_USER}
@ -87,8 +87,8 @@ async def test_form_read_only(hass: HomeAssistant) -> None:
(UptimeRobotAuthenticationException, "invalid_api_key"), (UptimeRobotAuthenticationException, "invalid_api_key"),
], ],
) )
async def test_form_exception_thrown(hass: HomeAssistant, exception, error_key) -> None: async def test_exception_thrown(hass: HomeAssistant, exception, error_key) -> None:
"""Test that we handle exceptions.""" """Test user flow throwing exceptions."""
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER} DOMAIN, context={"source": config_entries.SOURCE_USER}
) )
@ -106,10 +106,8 @@ async def test_form_exception_thrown(hass: HomeAssistant, exception, error_key)
assert result2["errors"]["base"] == error_key assert result2["errors"]["base"] == error_key
async def test_form_api_error( async def test_api_error(hass: HomeAssistant, caplog: pytest.LogCaptureFixture) -> None:
hass: HomeAssistant, caplog: pytest.LogCaptureFixture """Test expected API error is catch."""
) -> None:
"""Test we handle unexpected error."""
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER} DOMAIN, context={"source": config_entries.SOURCE_USER}
) )

View File

@ -239,7 +239,6 @@ async def test_device_management(
freezer.tick(COORDINATOR_UPDATE_INTERVAL) freezer.tick(COORDINATOR_UPDATE_INTERVAL)
async_fire_time_changed(hass) async_fire_time_changed(hass)
await hass.async_block_till_done() await hass.async_block_till_done()
await hass.async_block_till_done()
devices = dr.async_entries_for_config_entry(device_registry, mock_entry.entry_id) devices = dr.async_entries_for_config_entry(device_registry, mock_entry.entry_id)
assert len(devices) == 1 assert len(devices) == 1