34
34
35
35
import chip .clusters as Clusters
36
36
from chip .clusters .Types import Nullable , NullValue
37
+ from chip .testing import matter_asserts
37
38
from chip .testing .matter_testing import MatterBaseTest , TestStep , async_test_body , default_matter_test_main
38
39
from mobly import asserts
39
40
@@ -131,7 +132,7 @@ async def test_TC_DGWIFI_2_1(self):
131
132
# Just do a minimal check here; you can refine or extend based on the spec.
132
133
if security_type is not NullValue :
133
134
security_type_value = security_type .Value
134
- self .assert_valid_uint8 (security_type_value , "SecurityType" )
135
+ matter_asserts .assert_valid_uint8 (security_type_value , "SecurityType" )
135
136
136
137
# Check if the security_type is a valid SecurityTypeEnum member
137
138
self .assert_true (
@@ -154,7 +155,7 @@ async def test_TC_DGWIFI_2_1(self):
154
155
# WiFiVersion is an enum. If not configured or operational, might be NULL.
155
156
if wifi_version is not NullValue :
156
157
wifi_version_value = wifi_version .Value
157
- self .assert_valid_uint8 (wifi_version_value , "WiFiVersion" )
158
+ matter_asserts .assert_valid_uint8 (wifi_version_value , "WiFiVersion" )
158
159
159
160
# Check if the wifi_version is a valid WiFiVersionEnum member
160
161
self .assert_true (wifi_version_value in [item .value for item in Clusters .Objects .WiFiNetworkDiagnostics .Enums .WiFiVersionEnum ],
@@ -171,7 +172,7 @@ async def test_TC_DGWIFI_2_1(self):
171
172
channel_number = await self .read_dgwifi_attribute_expect_success (endpoint = endpoint , attribute = attributes .ChannelNumber )
172
173
# If not operational, might be NULL. Else we expect an unsigned integer channel.
173
174
if channel_number is not NullValue :
174
- self .assert_valid_uint16 (channel_number .Value , "ChannelNumber" )
175
+ matter_asserts .assert_valid_uint16 (channel_number .Value , "ChannelNumber" )
175
176
176
177
#
177
178
# STEP 6: TH reads RSSI attribute
@@ -195,7 +196,7 @@ async def test_TC_DGWIFI_2_1(self):
195
196
"BeaconLostCount must be of type 'Nullable' when not None." )
196
197
197
198
if beacon_lost_count is not NullValue :
198
- self .assert_valid_uint32 (beacon_lost_count .Value , "BeaconLostCount" )
199
+ matter_asserts .assert_valid_uint32 (beacon_lost_count .Value , "BeaconLostCount" )
199
200
200
201
#
201
202
# STEP 8: TH reads BeaconRxCount attribute
@@ -207,7 +208,7 @@ async def test_TC_DGWIFI_2_1(self):
207
208
"BeaconRxCount must be of type 'Nullable' when not None." )
208
209
209
210
if beacon_rx_count is not NullValue :
210
- self .assert_valid_uint32 (beacon_rx_count .Value , "BeaconRxCount" )
211
+ matter_asserts .assert_valid_uint32 (beacon_rx_count .Value , "BeaconRxCount" )
211
212
212
213
#
213
214
# STEP 9: TH reads PacketMulticastRxCount attribute
@@ -219,7 +220,7 @@ async def test_TC_DGWIFI_2_1(self):
219
220
"PacketMulticastRxCount must be of type 'Nullable' when not None." )
220
221
221
222
if pkt_multi_rx is not NullValue :
222
- self .assert_valid_uint32 (pkt_multi_rx .Value , "PacketMulticastRxCount" )
223
+ matter_asserts .assert_valid_uint32 (pkt_multi_rx .Value , "PacketMulticastRxCount" )
223
224
224
225
#
225
226
# STEP 10: TH reads PacketMulticastTxCount attribute
@@ -231,7 +232,7 @@ async def test_TC_DGWIFI_2_1(self):
231
232
"PacketMulticastTxCount must be of type 'Nullable' when not None." )
232
233
233
234
if pkt_multi_tx is not NullValue :
234
- self .assert_valid_uint32 (pkt_multi_tx .Value , "PacketMulticastTxCount" )
235
+ matter_asserts .assert_valid_uint32 (pkt_multi_tx .Value , "PacketMulticastTxCount" )
235
236
236
237
#
237
238
# STEP 11: TH reads PacketUnicastRxCount attribute
@@ -243,7 +244,7 @@ async def test_TC_DGWIFI_2_1(self):
243
244
"PacketUnicastRxCount must be of type 'Nullable' when not None." )
244
245
245
246
if pkt_uni_rx is not NullValue :
246
- self .assert_valid_uint32 (pkt_uni_rx .Value , "PacketUnicastRxCount" )
247
+ matter_asserts .assert_valid_uint32 (pkt_uni_rx .Value , "PacketUnicastRxCount" )
247
248
248
249
#
249
250
# STEP 12: TH reads PacketUnicastTxCount attribute
@@ -255,7 +256,7 @@ async def test_TC_DGWIFI_2_1(self):
255
256
"PacketUnicastTxCount must be of type 'Nullable' when not None." )
256
257
257
258
if pkt_uni_tx is not NullValue :
258
- self .assert_valid_uint32 (pkt_uni_tx .Value , "PacketUnicastTxCount" )
259
+ matter_asserts .assert_valid_uint32 (pkt_uni_tx .Value , "PacketUnicastTxCount" )
259
260
260
261
#
261
262
# STEP 13: TH reads CurrentMaxRate attribute
@@ -268,7 +269,7 @@ async def test_TC_DGWIFI_2_1(self):
268
269
"CurrentMaxRate must be of type 'Nullable' when not None." )
269
270
270
271
if current_max_rate is not NullValue :
271
- self .assert_valid_uint64 (current_max_rate .Value , "CurrentMaxRate" )
272
+ matter_asserts .assert_valid_uint64 (current_max_rate .Value , "CurrentMaxRate" )
272
273
273
274
#
274
275
# STEP 14: TH reads OverrunCount attribute
@@ -281,7 +282,7 @@ async def test_TC_DGWIFI_2_1(self):
281
282
"OverrunCount must be of type 'Nullable' when not None." )
282
283
283
284
if overrun_count is not NullValue :
284
- self .assert_valid_uint64 (overrun_count .Value , "OverrunCount" )
285
+ matter_asserts .assert_valid_uint64 (overrun_count .Value , "OverrunCount" )
285
286
286
287
287
288
if __name__ == "__main__" :
0 commit comments