2022-07-08 23:55:31 +00:00
|
|
|
"""Tests for the Bluetooth integration."""
|
|
|
|
|
|
|
|
|
|
|
|
import bleak
|
|
|
|
|
|
|
|
from homeassistant.components.bluetooth.models import HaBleakScannerWrapper
|
2022-07-22 18:19:53 +00:00
|
|
|
from homeassistant.components.bluetooth.usage import (
|
|
|
|
install_multiple_bleak_catcher,
|
|
|
|
uninstall_multiple_bleak_catcher,
|
|
|
|
)
|
2022-07-08 23:55:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def test_multiple_bleak_scanner_instances(hass):
|
2022-07-22 18:19:53 +00:00
|
|
|
"""Test creating multiple BleakScanners without an integration."""
|
|
|
|
install_multiple_bleak_catcher()
|
2022-07-08 23:55:31 +00:00
|
|
|
|
|
|
|
instance = bleak.BleakScanner()
|
|
|
|
|
|
|
|
assert isinstance(instance, HaBleakScannerWrapper)
|
2022-07-22 18:19:53 +00:00
|
|
|
|
|
|
|
uninstall_multiple_bleak_catcher()
|
|
|
|
|
|
|
|
instance = bleak.BleakScanner()
|
|
|
|
|
|
|
|
assert not isinstance(instance, HaBleakScannerWrapper)
|