mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Fix bluetooth tests to not create the same config entry twice (#127461)
This commit is contained in:
parent
13e7af7762
commit
41fcf58b80
@ -2872,7 +2872,7 @@ async def test_default_address_config_entries_removed_linux(
|
|||||||
assert not hass.config_entries.async_entries(bluetooth.DOMAIN)
|
assert not hass.config_entries.async_entries(bluetooth.DOMAIN)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("enable_bluetooth", "one_adapter")
|
@pytest.mark.usefixtures("one_adapter")
|
||||||
async def test_can_unsetup_bluetooth_single_adapter_linux(
|
async def test_can_unsetup_bluetooth_single_adapter_linux(
|
||||||
hass: HomeAssistant, mock_bleak_scanner_start: MagicMock
|
hass: HomeAssistant, mock_bleak_scanner_start: MagicMock
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -2890,12 +2890,17 @@ async def test_can_unsetup_bluetooth_single_adapter_linux(
|
|||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("enable_bluetooth", "two_adapters")
|
@pytest.mark.usefixtures("two_adapters")
|
||||||
async def test_can_unsetup_bluetooth_multiple_adapters(
|
async def test_can_unsetup_bluetooth_multiple_adapters(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_bleak_scanner_start: MagicMock,
|
mock_bleak_scanner_start: MagicMock,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test we can setup and unsetup bluetooth with multiple adapters."""
|
"""Test we can setup and unsetup bluetooth with multiple adapters."""
|
||||||
|
# Setup bluetooth first since otherwise loading the first
|
||||||
|
# config entry will load the second one as well
|
||||||
|
await async_setup_component(hass, bluetooth.DOMAIN, {})
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
entry1 = MockConfigEntry(
|
entry1 = MockConfigEntry(
|
||||||
domain=bluetooth.DOMAIN, data={}, unique_id="00:00:00:00:00:01"
|
domain=bluetooth.DOMAIN, data={}, unique_id="00:00:00:00:00:01"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user