Skip to content

Commit f1f25a7

Browse files
committed
Fix tests
1 parent be95889 commit f1f25a7

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

tests/test_ash.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,7 @@ async def test_ash_protocol_startup(caplog):
438438

439439
assert ezsp.reset_received.mock_calls == [call(t.NcpResetCode.RESET_SOFTWARE)]
440440
assert protocol._write_frame.mock_calls == [
441-
# We send three
442-
call(ash.RstFrame(), prefix=(ash.Reserved.CANCEL,)),
443-
call(ash.RstFrame(), prefix=(ash.Reserved.CANCEL,)),
444-
call(ash.RstFrame(), prefix=(ash.Reserved.CANCEL,)),
441+
call(ash.RstFrame(), prefix=40 * (ash.Reserved.CANCEL,))
445442
]
446443

447444
protocol._write_frame.reset_mock()

tests/test_ezsp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@ async def test_ezsp_connect_failure(disconnect_mock, reset_mock, version_mock):
299299
await ezsp.connect()
300300

301301
assert conn_mock.await_count == 1
302-
assert reset_mock.await_count == 5
303-
assert version_mock.await_count == 5
302+
assert reset_mock.await_count == 3
303+
assert version_mock.await_count == 3
304304
assert disconnect_mock.call_count == 1
305305

306306

307-
@pytest.mark.parametrize("failures_before_success", [1, 2, 3, 4])
307+
@pytest.mark.parametrize("failures_before_success", [1, 2])
308308
@patch.object(EZSP, "disconnect", new_callable=AsyncMock)
309309
async def test_ezsp_connect_retry_success(disconnect_mock, failures_before_success):
310310
"""Test connection succeeding after N failures."""
@@ -319,7 +319,7 @@ async def startup_reset_mock():
319319
with patch("bellows.uart.connect"):
320320
ezsp = make_ezsp(version=4)
321321

322-
with patch.object(ezsp, "startup_reset", side_effect=startup_reset_mock):
322+
with patch.object(ezsp, "_startup_reset", side_effect=startup_reset_mock):
323323
await ezsp.connect()
324324

325325
assert call_count == failures_before_success + 1

0 commit comments

Comments
 (0)