tests/virtual-image: Use introspection names for errors
This commit is contained in:
parent
355cae1bbd
commit
6eb06697e9
1 changed files with 2 additions and 4 deletions
|
@ -101,14 +101,12 @@ class VirtualImage(unittest.TestCase):
|
||||||
del self.con
|
del self.con
|
||||||
self.dev.close_sync()
|
self.dev.close_sync()
|
||||||
|
|
||||||
def send_retry(self, retry_error=1, iterate=True):
|
def send_retry(self, retry_error=FPrint.DeviceRetry.TOO_SHORT, iterate=True):
|
||||||
# The default (1) is too-short
|
|
||||||
self.con.sendall(struct.pack('ii', -1, retry_error))
|
self.con.sendall(struct.pack('ii', -1, retry_error))
|
||||||
while iterate and ctx.pending():
|
while iterate and ctx.pending():
|
||||||
ctx.iteration(False)
|
ctx.iteration(False)
|
||||||
|
|
||||||
def send_error(self, device_error=0, iterate=True):
|
def send_error(self, device_error=FPrint.DeviceError.GENERAL, iterate=True):
|
||||||
# The default (0) is a generic error
|
|
||||||
self.con.sendall(struct.pack('ii', -2, device_error))
|
self.con.sendall(struct.pack('ii', -2, device_error))
|
||||||
while iterate and ctx.pending():
|
while iterate and ctx.pending():
|
||||||
ctx.iteration(False)
|
ctx.iteration(False)
|
||||||
|
|
Loading…
Reference in a new issue