Adjust openai_conversation tests which create devices (#98203)

This commit is contained in:
Erik Montnemery 2023-08-10 18:24:19 +02:00 committed by GitHub
parent 13a9b83ed3
commit 9d3be60b05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,11 +22,13 @@ async def test_default_prompt(
snapshot: SnapshotAssertion,
) -> None:
"""Test that the default prompt works."""
entry = MockConfigEntry(title=None)
entry.add_to_hass(hass)
for i in range(3):
area_registry.async_create(f"{i}Empty Area")
device_registry.async_get_or_create(
config_entry_id="1234",
config_entry_id=entry.entry_id,
connections={("test", "1234")},
name="Test Device",
manufacturer="Test Manufacturer",
@ -35,7 +37,7 @@ async def test_default_prompt(
)
for i in range(3):
device_registry.async_get_or_create(
config_entry_id="1234",
config_entry_id=entry.entry_id,
connections={("test", f"{i}abcd")},
name="Test Service",
manufacturer="Test Manufacturer",
@ -44,7 +46,7 @@ async def test_default_prompt(
entry_type=dr.DeviceEntryType.SERVICE,
)
device_registry.async_get_or_create(
config_entry_id="1234",
config_entry_id=entry.entry_id,
connections={("test", "5678")},
name="Test Device 2",
manufacturer="Test Manufacturer 2",
@ -52,7 +54,7 @@ async def test_default_prompt(
suggested_area="Test Area 2",
)
device_registry.async_get_or_create(
config_entry_id="1234",
config_entry_id=entry.entry_id,
connections={("test", "9876")},
name="Test Device 3",
manufacturer="Test Manufacturer 3",
@ -60,13 +62,13 @@ async def test_default_prompt(
suggested_area="Test Area 2",
)
device_registry.async_get_or_create(
config_entry_id="1234",
config_entry_id=entry.entry_id,
connections={("test", "qwer")},
name="Test Device 4",
suggested_area="Test Area 2",
)
device = device_registry.async_get_or_create(
config_entry_id="1234",
config_entry_id=entry.entry_id,
connections={("test", "9876-disabled")},
name="Test Device 3",
manufacturer="Test Manufacturer 3",
@ -77,14 +79,14 @@ async def test_default_prompt(
device.id, disabled_by=dr.DeviceEntryDisabler.USER
)
device_registry.async_get_or_create(
config_entry_id="1234",
config_entry_id=entry.entry_id,
connections={("test", "9876-no-name")},
manufacturer="Test Manufacturer NoName",
model="Test Model NoName",
suggested_area="Test Area 2",
)
device_registry.async_get_or_create(
config_entry_id="1234",
config_entry_id=entry.entry_id,
connections={("test", "9876-integer-values")},
name=1,
manufacturer=2,