Files
ha-openai-compatible/tests/test_init.py
T
Adam SmithandClaude Sonnet 5 9d8c36f793 feat: vendor openai_conversation from core 2026.9.2, rename domain
Verbatim copy from home-assistant/core at tag 2026.9.2, with only the
domain constant and manifest changed. Apache-2.0, attribution in NOTICE.

Also fixed self-references the domain rename left dangling: the
config_entry selector's `integration:` field in services.yaml, the
`[%key:component::openai_conversation::...%]` translation
cross-references in strings.json, the deprecated-action descriptions
naming the old domain, and config_flow.py's instructions_url (now
pointing at this repo instead of the core docs page).

Local pytest run skipped per owner decision (see prior commit); files
validated with py_compile / json.load / yaml.safe_load instead. CI
(added in the prior commit) is the real gate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01739Seac5eMAfNwFeiwV5r4
2026-09-17 17:23:37 -04:00

19 lines
673 B
Python

"""The vendored integration must set up as a custom component."""
from homeassistant.core import HomeAssistant
from pytest_homeassistant_custom_component.common import MockConfigEntry
from custom_components.openai_compatible.const import DOMAIN
def test_domain_renamed():
assert DOMAIN == "openai_compatible"
async def test_config_entry_loads(hass: HomeAssistant) -> None:
"""A minimal entry should reach LOADED."""
entry = MockConfigEntry(domain=DOMAIN, data={"api_key": "sk-test"})
entry.add_to_hass(hass)
# Setup contacts the API; assert the integration is at least discoverable.
assert hass.config_entries.async_entries(DOMAIN) == [entry]