MCPcopy Create free account
hub / github.com/kiibohd/controller / SystemCodeVerification

Class SystemCodeVerification

Scan/TestIn/Tests/common.py:1269–1314  ·  view source on GitHub ↗

SysCode capability verification Validates that a specified capability behaved as expected

Source from the content-addressed store, hash-verified

1267
1268
1269class SystemCodeVerification(CapabilityVerification):
1270 '''
1271 SysCode capability verification
1272
1273 Validates that a specified capability behaved as expected
1274 '''
1275 def verify(self, state):
1276 '''
1277 Verify System Code
1278
1279 @param: State of result
1280
1281 @return: True if verification is successful, False otherwise
1282 '''
1283 import interface as i
1284
1285 # Get expected data (only one argument)
1286 expected = self.parent.expected_args[0]
1287
1288 # Get USB Keyboard data
1289 data = i.control.data.usb_keyboard()
1290
1291 logger.debug("Data: {} Expected: {}", data, expected)
1292
1293 # Check for expected data
1294 result = False
1295 match = False
1296 if expected == data.systemcode:
1297 match = True
1298
1299 # Off or Release
1300 if state == 0 or state == 3:
1301 if not match:
1302 result = True
1303
1304 # Press or Hold
1305 elif state == 1 or state == 2:
1306 if match:
1307 result = True
1308
1309 return check(result, "test:{} expectedsystem:{} state({}) - found:{}".format(
1310 self.parent.parent.parent.parent.cur_test,
1311 expected,
1312 state,
1313 data
1314 ))
1315
1316
1317class AnimationVerification(CapabilityVerification):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…