hass-core/tests/components/openai_conversation/conftest.py
Paulus Schoutsen 7d641e4d3e
Add OpenAI integration (#86621)
* Add OpenAI integration

* Remove empty manifest fields

* More prompt tweaks

* Update manifest

* Update homeassistant/components/openai_conversation/config_flow.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Address comments

* Add full integration tests

* Cripple the integration

* Test single instance

Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-25 11:30:13 -05:00

31 lines
697 B
Python

"""Tests helpers."""
from unittest.mock import patch
import pytest
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
@pytest.fixture
def mock_config_entry(hass):
"""Mock a config entry."""
entry = MockConfigEntry(
domain="openai_conversation",
data={
"api_key": "bla",
},
)
entry.add_to_hass(hass)
return entry
@pytest.fixture
async def mock_init_component(hass, mock_config_entry):
"""Initialize integration."""
with patch(
"openai.Engine.list",
):
assert await async_setup_component(hass, "openai_conversation", {})
await hass.async_block_till_done()