mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
virtual-device: Make possible to inject sleep events while verifying/identifying
Each command should be separated by SLEEP to be considered as something we want to perform during the current operation, otherwise will be used by next operation consuming it.
This commit is contained in:
@@ -526,6 +526,25 @@ class VirtualDevice(unittest.TestCase):
|
||||
self.assertFalse(self._verify_completed)
|
||||
self.cancel_verify()
|
||||
|
||||
def test_device_sleep_before_completing_verify(self):
|
||||
enrolled = self.enroll_print('foo-print', FPrint.Finger.LEFT_RING)
|
||||
|
||||
self.send_command('SLEEP', 100)
|
||||
self.start_verify(enrolled, identify=self.dev.supports_identify())
|
||||
self.send_command('SCAN', 'bar-print')
|
||||
self.send_command('SLEEP', 800)
|
||||
|
||||
while not self._verify_reported:
|
||||
ctx.iteration(False)
|
||||
|
||||
self.assertFalse(self._verify_completed)
|
||||
self.wait_timeout(10)
|
||||
self.assertFalse(self._verify_completed)
|
||||
|
||||
self.complete_verify()
|
||||
self.assertTrue(self._verify_reported)
|
||||
|
||||
|
||||
class VirtualDeviceStorage(VirtualDevice):
|
||||
|
||||
def tearDown(self):
|
||||
|
||||
Reference in New Issue
Block a user