From 9a85bfa57f4343128d39863eba31a8eb0986e565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Sun, 24 Jan 2021 22:02:29 +0100 Subject: [PATCH] tests/fprintd: Ensure the scan type can be changed and is notified --- tests/fprintd.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/fprintd.py b/tests/fprintd.py index fd462af..6c4807e 100644 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -822,6 +822,18 @@ class FPrintdVirtualStorageDeviceTests(FPrintdVirtualStorageDeviceBaseTest): self.enroll_print('FP1-20000101-7-ABCDEFGH-testuser', 'left-index-finger') self.assertEqual(self.device.ListEnrolledFingers('(s)', 'testuser'), ['left-index-finger']) + def test_scan_type_changes(self): + self.device.Claim('(s)', 'testuser') + self.addCleanup(self.device.Release) + + for scan_type in [FPrint.ScanType.PRESS, FPrint.ScanType.SWIPE]: + scan_type = scan_type.value_nick + self.send_command('SET_SCAN_TYPE', scan_type) + while self.device.get_cached_property('scan-type').unpack() != scan_type: + ctx.iteration(True) + self.assertIn({'scan-type': scan_type}, self._changed_properties) + self.assertEqual(self.device.get_cached_property('scan-type').unpack(), scan_type) + class FPrintdVirtualNoStorageDeviceBaseTest(FPrintdVirtualStorageDeviceBaseTest): socket_env = 'FP_VIRTUAL_DEVICE'