mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-11-27 00:10:12 +00:00
=================================== FAILURES ===================================
_______________ test_resync_fails_when_the_reset_is_not_answered _______________
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7ffff2f8ff50>
@requires_pty
async def test_resync_fails_when_the_reset_is_not_answered(monkeypatch):
monkeypatch.setattr(serial, 'RESYNC_MAX_TIME', 0.3)
fake_controller = FakeSerialController(honors_reset=False)
try:
loop = asyncio.get_running_loop()
started_at = loop.time()
with pytest.raises(common.TransportInitError) as error:
await asyncio.wait_for(
serial.open_serial_transport(f'{fake_controller.path},resync'), 5
)
assert loop.time() - started_at >= 0.3
assert 'did not answer' in str(error.value)
assert fake_controller.received == bytes(serial.RESYNC_PADDING_SIZE) + HCI_RESET
await asyncio.sleep(0.1)
> assert fake_controller.open_count() == 1
E assert 4 == 1
E + where 4 = open_count()
E + where open_count = <tests.transport.transport_test.FakeSerialController object at 0x7ffff2cc44d0>.open_count
tests/transport/transport_test.py:515: AssertionError