Skip to content

Commit 718fcea

Browse files
committed
Fix unit tests
1 parent dc67ac8 commit 718fcea

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

tests/test_api.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,8 @@ async def test_connect(monkeypatch):
4040
def test_close(api):
4141
"""Test connection close."""
4242
uart = api._uart
43-
conn_lost_task = mock.MagicMock()
44-
api._conn_lost_task = conn_lost_task
45-
4643
api.close()
4744

48-
assert api._conn_lost_task is None
49-
assert conn_lost_task.cancel.call_count == 1
5045
assert api._uart is None
5146
assert uart.close.call_count == 1
5247

tests/test_application.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ def _at_command_mock(cmd, *args):
363363
"SH": 0x08070605,
364364
"SL": 0x04030201,
365365
"ZS": zs,
366+
"VR": 0x1234,
366367
}.get(cmd, None)
367368

368369
def init_api_mode_mock():
@@ -441,20 +442,6 @@ async def test_permit(app):
441442
assert app._api._at_command.call_args_list[0][0][1] == time_s
442443

443444

444-
async def test_permit_with_key(app):
445-
"""Test permit joins with join code."""
446-
app._api._command = mock.AsyncMock(return_value=xbee_t.TXStatus.SUCCESS)
447-
app._api._at_command = mock.AsyncMock(return_value="OK")
448-
node = t.EUI64(b"\x01\x02\x03\x04\x05\x06\x07\x08")
449-
code = b"\xC9\xA7\xD2\x44\x1A\x71\x16\x95\xCD\x62\x17\x0D\x33\x28\xEA\x2B\x42\x3D"
450-
time_s = 500
451-
await app.permit_with_key(node=node, code=code, time_s=time_s)
452-
app._api._at_command.assert_called_once_with("KT", time_s)
453-
app._api._command.assert_called_once_with(
454-
"register_joining_device", node, 0xFFFE, 1, code
455-
)
456-
457-
458445
async def test_permit_with_link_key(app):
459446
"""Test permit joins with link key."""
460447
app._api._command = mock.AsyncMock(return_value=xbee_t.TXStatus.SUCCESS)

0 commit comments

Comments
 (0)