1111
1212from homeassistant .components .portainer .const import DOMAIN
1313from homeassistant .config_entries import ConfigEntryState
14- from homeassistant .const import CONF_API_KEY , CONF_API_TOKEN , CONF_HOST , CONF_URL
14+ from homeassistant .const import (
15+ CONF_API_KEY ,
16+ CONF_API_TOKEN ,
17+ CONF_HOST ,
18+ CONF_URL ,
19+ CONF_VERIFY_SSL ,
20+ )
1521from homeassistant .core import HomeAssistant
1622
1723from . import setup_integration
@@ -40,8 +46,8 @@ async def test_setup_exceptions(
4046 assert mock_config_entry .state == expected_state
4147
4248
43- async def test_v1_migration (hass : HomeAssistant ) -> None :
44- """Test migration from v1 to v2 config entry."""
49+ async def test_migrations (hass : HomeAssistant ) -> None :
50+ """Test migration from v1 config entry."""
4551 entry = MockConfigEntry (
4652 domain = DOMAIN ,
4753 data = {
@@ -52,11 +58,14 @@ async def test_v1_migration(hass: HomeAssistant) -> None:
5258 version = 1 ,
5359 )
5460 entry .add_to_hass (hass )
61+ assert entry .version == 1
62+ assert CONF_VERIFY_SSL not in entry .data
5563 await hass .config_entries .async_setup (entry .entry_id )
5664 await hass .async_block_till_done ()
5765
58- assert entry .version == 2
66+ assert entry .version == 3
5967 assert CONF_HOST not in entry .data
6068 assert CONF_API_KEY not in entry .data
6169 assert entry .data [CONF_URL ] == "http://test_host"
6270 assert entry .data [CONF_API_TOKEN ] == "test_key"
71+ assert entry .data [CONF_VERIFY_SSL ] is True
0 commit comments