Skip to content

Commit

Permalink
Rename client to ws_client to avoid confusion with Unifi clients
Browse files Browse the repository at this point in the history
  • Loading branch information
wittypluck committed Apr 28, 2024
1 parent 332a285 commit 674927d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/components/unifi/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,21 @@ async def test_remove_config_entry_device(
assert await async_setup_component(hass, "config", {})
await hass.async_block_till_done()

client = await hass_ws_client(hass)
ws_client = await hass_ws_client(hass)

# Try to remove an active client from UI: not allowed
device_entry = device_registry.async_get_device(
connections={(dr.CONNECTION_NETWORK_MAC, client_1["mac"])}
)
await client.send_json(
await ws_client.send_json(
{
"id": 1,
"type": "config/device_registry/remove_config_entry",
"config_entry_id": config_entry.entry_id,
"device_id": device_entry.id,
}
)
response = await client.receive_json()
response = await ws_client.receive_json()
assert not response["success"]
await hass.async_block_till_done()
assert device_registry.async_get_device(
Expand All @@ -202,15 +202,15 @@ async def test_remove_config_entry_device(
device_entry = device_registry.async_get_device(
connections={(dr.CONNECTION_NETWORK_MAC, device_1["mac"])}
)
await client.send_json(
await ws_client.send_json(
{
"id": 2,
"type": "config/device_registry/remove_config_entry",
"config_entry_id": config_entry.entry_id,
"device_id": device_entry.id,
}
)
response = await client.receive_json()
response = await ws_client.receive_json()
assert not response["success"]
await hass.async_block_till_done()
assert device_registry.async_get_device(
Expand All @@ -225,15 +225,15 @@ async def test_remove_config_entry_device(
device_entry = device_registry.async_get_device(
connections={(dr.CONNECTION_NETWORK_MAC, client_2["mac"])}
)
await client.send_json(
await ws_client.send_json(
{
"id": 3,
"type": "config/device_registry/remove_config_entry",
"config_entry_id": config_entry.entry_id,
"device_id": device_entry.id,
}
)
response = await client.receive_json()
response = await ws_client.receive_json()
assert response["success"]
await hass.async_block_till_done()
assert not device_registry.async_get_device(
Expand Down

0 comments on commit 674927d

Please sign in to comment.