Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions avatar/cases/le_host_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from pandora.host_pb2 import Connection
from pandora.host_pb2 import DataTypes
from pandora.host_pb2 import OwnAddressType
from pandora.host_pb2 import ScanningResponse
from typing import Any, Dict, Literal, Optional, Union


Expand Down Expand Up @@ -200,12 +201,12 @@ async def test_connect(self, ref_address_type: OwnAddressType) -> None:
)

scan = self.dut.aio.host.Scan(own_address_type=RANDOM, timeout=self.scan_timeout)
ref = await anext((x async for x in scan if x.data.manufacturer_specific_data == b'pause cafe'))
ref: ScanningResponse = await anext((x async for x in scan if x.data.manufacturer_specific_data == b'pause cafe'))
scan.cancel()

ref_dut_res, dut_ref_res = await asyncio.gather(
anext(aiter(advertise)),
self.dut.aio.host.ConnectLE(**ref.address_asdict(), own_address_type=RANDOM, timeout=self.scan_timeout),
self.dut.aio.host.ConnectLE(public=ref.public, public_identity=ref.public_identity, random=ref.random, random_static_identity=ref.random_static_identity, own_address_type=RANDOM, timeout=self.scan_timeout),
)
assert_equal(dut_ref_res.result_variant(), 'connection')
dut_ref, ref_dut = dut_ref_res.connection, ref_dut_res.connection
Expand All @@ -228,12 +229,12 @@ async def test_disconnect(self, ref_address_type: OwnAddressType) -> None:
)

scan = self.dut.aio.host.Scan(own_address_type=RANDOM, timeout=self.scan_timeout)
ref = await anext((x async for x in scan if x.data.manufacturer_specific_data == b'pause cafe'))
ref: ScanningResponse = await anext((x async for x in scan if x.data.manufacturer_specific_data == b'pause cafe'))
scan.cancel()

ref_dut_res, dut_ref_res = await asyncio.gather(
anext(aiter(advertise)),
self.dut.aio.host.ConnectLE(**ref.address_asdict(), own_address_type=RANDOM, timeout=self.scan_timeout),
self.dut.aio.host.ConnectLE(public=ref.public, public_identity=ref.public_identity, random=ref.random, random_static_identity=ref.random_static_identity, own_address_type=RANDOM, timeout=self.scan_timeout),
)
assert_equal(dut_ref_res.result_variant(), 'connection')
dut_ref, ref_dut = dut_ref_res.connection, ref_dut_res.connection
Expand Down