Adjust google_generative_ai_conversation tests which create devices (#98192)

pull/97823/head^2
Erik Montnemery 2023-08-10 18:23:13 +02:00 committed by GitHub
parent f11f7ac45c
commit 4329a47ef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -20,11 +20,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",
@ -33,7 +35,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",
@ -42,7 +44,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",
@ -50,7 +52,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",
@ -58,13 +60,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",
@ -75,14 +77,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,