mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
tests/virtual-device: Properly handle exceptions on enroll callback
We need to get them back to the caller function to be caught by the test suite.
This commit is contained in:
@@ -156,7 +156,10 @@ class VirtualDevice(unittest.TestCase):
|
||||
|
||||
def done_cb(dev, res):
|
||||
print("Enroll done")
|
||||
self._enrolled = dev.enroll_finish(res)
|
||||
try:
|
||||
self._enrolled = dev.enroll_finish(res)
|
||||
except Exception as e:
|
||||
self._enrolled = e
|
||||
|
||||
self._enroll_stage = -1
|
||||
def progress_cb(dev, stage, pnt, data, error):
|
||||
@@ -172,6 +175,9 @@ class VirtualDevice(unittest.TestCase):
|
||||
if self._enroll_stage < 0 and not self._enrolled:
|
||||
return True
|
||||
|
||||
if isinstance(self._enrolled, Exception):
|
||||
raise(self._enrolled)
|
||||
|
||||
nonlocal retries
|
||||
self.assertLessEqual(self._enroll_stage, self.dev.get_nr_enroll_stages())
|
||||
if should_retry and retries > retry_scan:
|
||||
|
||||
Reference in New Issue
Block a user