GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit c02771d1 authored by Marco Trevisan's avatar Marco Trevisan Committed by Benjamin Berg
Browse files

goodixmoc: Add async identification test using on-owned deseralized prints

This simulates what fprintd does
parent 989d498e
...@@ -22,6 +22,13 @@ template = ...@@ -22,6 +22,13 @@ template =
def enroll_progress(*args): def enroll_progress(*args):
print('enroll progress: ' + str(args)) print('enroll progress: ' + str(args))
def identify_done(dev, res):
global identified
identified = True
identify_match, identify_print = dev.identify_finish(res)
print('indentification_done: ', identify_match, identify_print)
assert identify_match.equal(identify_print)
# List, enroll, list, verify, identify, delete # List, enroll, list, verify, identify, delete
print("enrolling") print("enrolling")
p = d.enroll_sync(template, None, enroll_progress, None) p = d.enroll_sync(template, None, enroll_progress, None)
...@@ -35,15 +42,27 @@ assert stored[0].equal(p) ...@@ -35,15 +42,27 @@ assert stored[0].equal(p)
print("verifying") print("verifying")
verify_res, verify_print = d.verify_sync(p) verify_res, verify_print = d.verify_sync(p)
print("verify done") print("verify done")
del p
assert verify_res == True assert verify_res == True
identify_match, identify_print = d.identify_sync(stored) identified = False
print("identify done") deserialized_prints = []
assert identify_match.equal(identify_print) for p in stored:
assert deserialized_prints[-1].equal(p)
del stored
print('async identifying')
d.identify(deserialized_prints, callback=identify_done)
del deserialized_prints
while not identified:
print("deleting") print("deleting")
d.delete_print_sync(p) d.delete_print_sync(p)
print("delete done") print("delete done")
d.close_sync() d.close_sync()
del d del d
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment