fix: pin test_base_url.py entries to version 2 so migration is skipped

MockConfigEntry defaults to version=1, which triggers
async_migrate_integration on component setup; that legacy path
indexes entry.data[CONF_API_KEY] directly and raised KeyError for the
new optional-api-key entry in test_api_key_optional, before
async_setup_entry (and thus AsyncOpenAI) was ever reached. Pin both
entries in this file to version=2/minor_version=7, matching the
config flow's current VERSION/MINOR_VERSION and conftest's
mock_config_entry fixture.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01739Seac5eMAfNwFeiwV5r4
This commit is contained in:
Adam SmithandClaude Sonnet 5 committed 2026-09-17 17:56:35 -04:00
1 parent df44abf158
commit 15889c905d
1 file changed
+4
+4
View File
@@ -13,6 +13,8 @@ async def test_client_built_with_base_url(hass: HomeAssistant) -> None:
entry = MockConfigEntry( entry = MockConfigEntry(
domain=DOMAIN, domain=DOMAIN,
data={"api_key": "sk-test", CONF_BASE_URL: "http://192.0.2.10:4000/v1"}, data={"api_key": "sk-test", CONF_BASE_URL: "http://192.0.2.10:4000/v1"},
version=2,
minor_version=7,
) )
entry.add_to_hass(hass) entry.add_to_hass(hass)
@@ -32,6 +34,8 @@ async def test_api_key_optional(hass: HomeAssistant) -> None:
entry = MockConfigEntry( entry = MockConfigEntry(
domain=DOMAIN, domain=DOMAIN,
data={CONF_BASE_URL: "http://192.0.2.10:4000/v1"}, data={CONF_BASE_URL: "http://192.0.2.10:4000/v1"},
version=2,
minor_version=7,
) )
entry.add_to_hass(hass) entry.add_to_hass(hass)