hass-core/tests/components/bluetooth/test_usage.py
J. Nick Koston 38bccadaa6
Add support for setting up and removing bluetooth in the UI (#75600)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-07-22 13:19:53 -05:00

25 lines
661 B
Python

"""Tests for the Bluetooth integration."""
import bleak
from homeassistant.components.bluetooth.models import HaBleakScannerWrapper
from homeassistant.components.bluetooth.usage import (
install_multiple_bleak_catcher,
uninstall_multiple_bleak_catcher,
)
async def test_multiple_bleak_scanner_instances(hass):
"""Test creating multiple BleakScanners without an integration."""
install_multiple_bleak_catcher()
instance = bleak.BleakScanner()
assert isinstance(instance, HaBleakScannerWrapper)
uninstall_multiple_bleak_catcher()
instance = bleak.BleakScanner()
assert not isinstance(instance, HaBleakScannerWrapper)