Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests broken by zigpy update #246

Merged
merged 4 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions tests/application/test_connect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
from unittest.mock import AsyncMock, patch

import pytest
Expand Down Expand Up @@ -201,15 +200,12 @@ async def test_disconnect_failure(device, make_application):


@pytest.mark.parametrize("device", [FormedLaunchpadCC26X2R1])
@patch("zigpy_znp.zigbee.application.ControllerApplication._watchdog_period", new=0.1)
async def test_watchdog(device, make_application):
app, znp_server = make_application(server_cls=device)
await app.startup(auto_form=False)

app._watchdog_feed = AsyncMock(wraps=app._watchdog_feed)

with patch("zigpy.application.ControllerApplication._watchdog_period", new=0.1):
await asyncio.sleep(0.6)

TheJulianJES marked this conversation as resolved.
Show resolved Hide resolved
await app.startup(auto_form=False)
assert len(app._watchdog_feed.mock_calls) >= 5

await app.shutdown()
4 changes: 2 additions & 2 deletions tests/application/test_joining.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def test_permit_join(device, mocker, make_application):
request=zdo_request_matcher(
dst_addr=t.AddrModeAddress(t.AddrMode.Broadcast, 0xFFFC),
command_id=zdo_t.ZDOCmd.Mgmt_Permit_Joining_req,
TSN=7,
TSN=2,
zdo_PermitDuration=10,
zdo_TC_Significant=0,
),
Expand Down Expand Up @@ -117,7 +117,7 @@ async def test_join_device(device, make_application):
IsBroadcast=t.Bool.false,
ClusterId=32822,
SecurityUse=0,
TSN=7,
TSN=1,
MacDst=0x0000,
Data=b"\x00",
),
Expand Down
6 changes: 3 additions & 3 deletions tests/application/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def test_zigpy_request(device, make_application):
app, znp_server = make_application(device)
await app.startup(auto_form=False)

TSN = 7
TSN = 1

device = app.add_initialized_device(ieee=t.EUI64(range(8)), nwk=0xAABB)

Expand Down Expand Up @@ -111,7 +111,7 @@ async def test_zigpy_request_failure(device, make_application, mocker):
app, znp_server = make_application(device)
await app.startup(auto_form=False)

TSN = 7
TSN = 1

device = app.add_initialized_device(ieee=t.EUI64(range(8)), nwk=0xAABB)

Expand Down Expand Up @@ -456,7 +456,7 @@ async def inner():

@pytest.mark.parametrize("device", [FormedLaunchpadCC26X2R1])
async def test_request_recovery_route_rediscovery_zdo(device, make_application, mocker):
TSN = 7
TSN = 1

app, znp_server = make_application(server_cls=device)

Expand Down