-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add basic scanner tests (#43)
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from habluetooth import ( | ||
BaseHaRemoteScanner, | ||
HaBluetoothConnector, | ||
) | ||
|
||
from bleak_esphome.backend.client import ESPHomeClientData | ||
from bleak_esphome.backend.scanner import ESPHomeScanner | ||
|
||
ESP_MAC_ADDRESS = "AA:BB:CC:DD:EE:FF" | ||
ESP_NAME = "proxy" | ||
|
||
|
||
def test_scanner(): | ||
connector = HaBluetoothConnector(ESPHomeClientData, ESP_MAC_ADDRESS, lambda: True) | ||
scanner = ESPHomeScanner(ESP_MAC_ADDRESS, ESP_NAME, connector, True) | ||
assert isinstance(scanner, BaseHaRemoteScanner) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pytest | ||
from bleak_retry_connector import BleakSlotManager | ||
from bluetooth_adapters import BluetoothAdapters | ||
from habluetooth import ( | ||
BluetoothManager, | ||
set_manager, | ||
) | ||
|
||
|
||
@pytest.fixture(scope="session", autouse=True) | ||
def manager(): | ||
slot_manager = BleakSlotManager() | ||
bluetooth_adapters = BluetoothAdapters() | ||
set_manager(BluetoothManager(bluetooth_adapters, slot_manager)) |