summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2021-03-02 17:07:40 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2021-03-02 17:15:14 +0100
commit8da1b5e7f54ba0b943a7b5f8450abfd5c275b0fa (patch)
treeccf1c9ac5bb3e2a1c76ce535ca92e7efac5bf398 /tests
parent6d21128b89d9a268e8f1ceddce822582ab575766 (diff)
device: Do not set the device in verification state if we've errored
During VerifyStart we may return early if there are no enrolled prints. In such case we don't require the verification to be stopped if we're using identification, but in the verification case we may leave the device into the verification state. So ensure we only set the device current state only when we're about to start it. Add tests ensuring those cases
Diffstat (limited to 'tests')
-rw-r--r--tests/fprintd.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/fprintd.py b/tests/fprintd.py
index fb74993..9408c8e 100644
--- a/tests/fprintd.py
+++ b/tests/fprintd.py
@@ -1780,6 +1780,25 @@ class FPrintdVirtualDeviceClaimedTest(FPrintdVirtualDeviceBaseTest):
with self.assertFprintError('NoEnrolledPrints'):
self.device.VerifyStart('(s)', 'right-thumb')
+ def test_verify_finger_not_enrolled_stops_verification(self):
+ self.enroll_image('whorl', finger='left-thumb')
+ with self.assertFprintError('NoEnrolledPrints'):
+ self.device.VerifyStart('(s)', 'right-thumb')
+
+ with self.assertFprintError('NoActionInProgress'):
+ self.device.VerifyStop()
+
+ def test_identify_finger_not_enrolled(self):
+ with self.assertFprintError('NoEnrolledPrints'):
+ self.device.VerifyStart('(s)', 'any')
+
+ def test_identify_finger_not_enrolled_stops_verification(self):
+ with self.assertFprintError('NoEnrolledPrints'):
+ self.device.VerifyStart('(s)', 'any')
+
+ with self.assertFprintError('NoActionInProgress'):
+ self.device.VerifyStop()
+
def test_unallowed_enroll_start(self):
self._polkitd_obj.SetAllowed([''])