SysCode capability verification Validates that a specified capability behaved as expected
| 1267 | |
| 1268 | |
| 1269 | class 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 | |
| 1317 | class AnimationVerification(CapabilityVerification): |
no outgoing calls
no test coverage detected
searching dependent graphs…