1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
From: Edward Betts <edward@4angle.com>
Date: Tue, 8 Jul 2025 11:00:00 +0200
Subject: Fix tests for new Bleak API
---
tests/test_models.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tests/test_models.py b/tests/test_models.py
index b8001f2..3f66bde 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -42,7 +42,7 @@ def test_model():
def test_model_from_bleak():
- switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}, -127)
+ switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {})
switchbot_adv = generate_advertisement_data(
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
)
@@ -58,7 +58,7 @@ def test_model_from_bleak():
def test_model_from_scanner():
- switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}, -127)
+ switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {})
switchbot_adv = generate_advertisement_data(
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
)
@@ -83,6 +83,7 @@ def test_model_from_scanner():
"connectable": True,
"manufacturer_data": {},
"name": "wohand",
+ "raw": None,
"rssi": -127,
"service_data": {},
"service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"],
@@ -93,7 +94,7 @@ def test_model_from_scanner():
def test_construct_service_info_bleak():
- switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}, -127)
+ switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {})
switchbot_adv = generate_advertisement_data(
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
)
@@ -129,6 +130,7 @@ def test_construct_service_info_bleak():
"connectable": False,
"manufacturer_data": {},
"name": "wohand",
+ "raw": None,
"rssi": -127,
"service_data": {},
"service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"],
@@ -140,7 +142,7 @@ def test_construct_service_info_bleak():
def test_from_device_and_advertisement_data():
"""Test creating a BluetoothServiceInfoBleak from a BLEDevice and AdvertisementData."""
- switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {}, -127)
+ switchbot_device = BLEDevice("44:44:33:11:23:45", "wohand", {})
switchbot_adv = generate_advertisement_data(
local_name="wohand", service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
)
@@ -163,6 +165,7 @@ def test_from_device_and_advertisement_data():
"connectable": True,
"manufacturer_data": {},
"name": "wohand",
+ "raw": None,
"rssi": -127,
"service_data": {},
"service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"],
@@ -187,7 +190,7 @@ def test_pyobjc_compat():
assert address == "44:44:33:11:23:45"
assert rssi == -127
- switchbot_device = BLEDevice(address, name, {}, rssi)
+ switchbot_device = BLEDevice(address, name, {})
switchbot_adv = generate_advertisement_data(
local_name=name, service_uuids=["cba20d00-224d-11e6-9fb8-0002a5d5c51b"]
)
@@ -223,6 +226,7 @@ def test_pyobjc_compat():
"connectable": False,
"manufacturer_data": {},
"name": "wohand",
+ "raw": None,
"rssi": -127,
"service_data": {},
"service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"],
|