Skip to content

Commit

Permalink
review again
Browse files Browse the repository at this point in the history
  • Loading branch information
jb101010-2 committed Dec 28, 2024
1 parent 5a14024 commit 2001134
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
1 change: 0 additions & 1 deletion homeassistant/components/suez_water/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ async def async_migrate_entry(
)

if config_entry.version > 2:
_LOGGER.error("Suez_water version downgrade not handled")
return False

if config_entry.version == 1:
Expand Down
24 changes: 1 addition & 23 deletions tests/components/suez_water/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,32 +84,10 @@ async def test_migration_version_1_to_2(
title=MOCK_DATA[CONF_USERNAME],
data=MOCK_DATA,
version=1,
minor_version=0,
)

await setup_integration(hass, past_entry)
assert past_entry.state is ConfigEntryState.LOADED
assert past_entry.unique_id == MOCK_DATA[CONF_COUNTER_ID]
assert past_entry.title == MOCK_DATA[CONF_USERNAME]


async def test_migration_version_1_to_2_int_counter(
hass: HomeAssistant,
suez_client: AsyncMock,
) -> None:
"""Test that a migration from 1 to 2 change use int counter_id as str unique_id."""
data = MOCK_DATA.copy()
data[CONF_COUNTER_ID] = 1234
past_entry = MockConfigEntry(
unique_id=data[CONF_USERNAME],
domain=DOMAIN,
title=data[CONF_USERNAME],
data=data,
version=1,
minor_version=0,
)

await setup_integration(hass, past_entry)
assert past_entry.state is ConfigEntryState.LOADED
assert past_entry.unique_id == str(data[CONF_COUNTER_ID])
assert past_entry.title == data[CONF_USERNAME]
assert past_entry.version == 2

0 comments on commit 2001134

Please sign in to comment.