Skip to content

Commit 718afd7

Browse files
committed
Begin fixing unit testing infrastructure
1 parent 4bf893c commit 718afd7

File tree

2 files changed

+197
-140
lines changed

2 files changed

+197
-140
lines changed

tests/application/test_requests.py

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import zigpy.zdo
55
import zigpy.endpoint
66
import zigpy.profiles
7-
from zigpy.zdo.types import ZDOCmd, SizePrefixedSimpleDescriptor
7+
from zigpy.zdo.types import ZDOCmd
88
from zigpy.exceptions import DeliveryError
99

1010
import zigpy_znp.types as t
@@ -15,55 +15,6 @@
1515
from ..conftest import FORMED_DEVICES, CoroutineMock, FormedLaunchpadCC26X2R1
1616

1717

18-
@pytest.mark.parametrize("device", FORMED_DEVICES)
19-
async def test_zdo_request_interception(device, make_application):
20-
app, znp_server = make_application(server_cls=device)
21-
await app.startup(auto_form=False)
22-
23-
device = app.add_initialized_device(ieee=t.EUI64(range(8)), nwk=0xFA9E)
24-
25-
# Send back a request response
26-
active_ep_req = znp_server.reply_once_to(
27-
request=c.ZDO.SimpleDescReq.Req(
28-
DstAddr=device.nwk, NWKAddrOfInterest=device.nwk, Endpoint=1
29-
),
30-
responses=[
31-
c.ZDO.SimpleDescReq.Rsp(Status=t.Status.SUCCESS),
32-
c.ZDO.SimpleDescRsp.Callback(
33-
Src=device.nwk,
34-
Status=t.ZDOStatus.SUCCESS,
35-
NWK=device.nwk,
36-
SimpleDescriptor=SizePrefixedSimpleDescriptor(
37-
*dict(
38-
endpoint=1,
39-
profile=49246,
40-
device_type=256,
41-
device_version=2,
42-
input_clusters=[0, 3, 4, 5, 6, 8, 2821, 4096],
43-
output_clusters=[5, 25, 32, 4096],
44-
).values()
45-
),
46-
),
47-
],
48-
)
49-
50-
status, message = await app.request(
51-
device=device,
52-
profile=260,
53-
cluster=ZDOCmd.Simple_Desc_req,
54-
src_ep=0,
55-
dst_ep=0,
56-
sequence=1,
57-
data=b"\x01\x9e\xfa\x01",
58-
use_ieee=False,
59-
)
60-
61-
assert status == t.Status.SUCCESS
62-
await active_ep_req
63-
64-
await app.shutdown()
65-
66-
6718
@pytest.mark.parametrize("device", FORMED_DEVICES)
6819
async def test_chosen_dst_endpoint(device, make_application, mocker):
6920
app, znp_server = make_application(device)
@@ -91,7 +42,7 @@ async def test_zigpy_request(device, make_application):
9142
app, znp_server = make_application(device)
9243
await app.startup(auto_form=False)
9344

94-
TSN = 6
45+
TSN = 7
9546

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

@@ -151,7 +102,7 @@ async def test_zigpy_request_failure(device, make_application, mocker):
151102
app, znp_server = make_application(device)
152103
await app.startup(auto_form=False)
153104

154-
TSN = 6
105+
TSN = 7
155106

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

0 commit comments

Comments
 (0)