Ejemplo n.º 1
0
 def test_scan_invalid_device(self):
     # we detect missing devices when scanning
     cmd = FPScanCommand(self.fpscan_path, ['-s', '--no-device', ])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert ret_code == 1
     assert stdout == b''
     assert stderr == b'Invalid device number: 0.\n'
Ejemplo n.º 2
0
 def test_detect_fail(self):
     # we can detect missing devices
     cmd = FPScanCommand(self.fpscan_path, ['--no-device', ])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert ret_code == 0
     assert stdout == b'0\n'
     assert stderr == b''
Ejemplo n.º 3
0
 def test_detect_ok(self):
     # we can detect devices
     cmd = FPScanCommand(self.fpscan_path)
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert ret_code == 0
     assert stdout == (b'Digital Persona U.are.U 4000/4000B/4500\n'
                       b'  2 0 1 0 1 384 290\n')
     assert stderr == b''
Ejemplo n.º 4
0
 def test_scan_fail(self):
     # scans can fail. We respect that
     cmd = FPScanCommand(self.fpscan_path, ['-s', '--scan-fail', ])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 1
     assert stdout == b'fail\n'
     assert stderr == b''
Ejemplo n.º 5
0
 def test_detect_fail(self):
     # we can detect missing devices
     cmd = FPScanCommand(self.fpscan_path, [
         '--no-device',
     ])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert ret_code == 0
     assert stdout == b'0\n'
     assert stderr == b''
Ejemplo n.º 6
0
 def test_compare_ok(self):
     # we can compare input with stored fingerprints
     stored_path = self.create_fake_data_fpm()
     cmd = FPScanCommand(self.fpscan_path, ['-c', '-i', stored_path])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 0
     assert stdout == b'ok\n'
     assert stderr == b''
Ejemplo n.º 7
0
 def test_detect_ok(self):
     # we can detect devices
     cmd = FPScanCommand(self.fpscan_path)
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert ret_code == 0
     assert stdout == (
         b'Digital Persona U.are.U 4000/4000B/4500\n'
         b'  2 0 1 0 1 384 290\n')
     assert stderr == b''
Ejemplo n.º 8
0
 def test_scan_invalid_device(self):
     # we detect missing devices when scanning
     cmd = FPScanCommand(self.fpscan_path, [
         '-s',
         '--no-device',
     ])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert ret_code == 1
     assert stdout == b''
     assert stderr == b'Invalid device number: 0.\n'
Ejemplo n.º 9
0
 def test_compare_fail(self):
     # we can detect failing comparisons by exit status
     stored_path = self.create_fake_data_fpm()
     cmd = FPScanCommand(
         self.fpscan_path, ['-c', '-i', stored_path, '--compare-fail'])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 1
     assert stdout == b'error: unknown reason\n'
     assert stderr == b''
Ejemplo n.º 10
0
 def test_compare_no_match(self):
     # we can detect non-matches when comparing fingerprints
     stored_path = self.create_fake_data_fpm()
     cmd = FPScanCommand(
         self.fpscan_path, ['-c', '-i', stored_path, '--compare-no-match'])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 0
     assert stdout == b'no-match\n'
     assert stderr == b''
Ejemplo n.º 11
0
 def test_scan_ok(self):
     # we can scan fingerprints (emulated)
     out_path = os.path.join(self.home_dir, 'data.fpm')
     cmd = FPScanCommand(self.fpscan_path, ['-s', '-o', out_path])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 0
     assert stdout == b'ok\n'
     assert stderr == b''
     assert os.path.exists(out_path)
Ejemplo n.º 12
0
 def test_compare_ok(self):
     # we can compare input with stored fingerprints
     stored_path = self.create_fake_data_fpm()
     cmd = FPScanCommand(self.fpscan_path, ['-c', '-i', stored_path])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 0
     assert stdout == b'ok\n'
     assert stderr == b''
Ejemplo n.º 13
0
 def test_compare_fail(self):
     # we can detect failing comparisons by exit status
     stored_path = self.create_fake_data_fpm()
     cmd = FPScanCommand(self.fpscan_path,
                         ['-c', '-i', stored_path, '--compare-fail'])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 1
     assert stdout == b'error: unknown reason\n'
     assert stderr == b''
Ejemplo n.º 14
0
 def test_compare_no_match(self):
     # we can detect non-matches when comparing fingerprints
     stored_path = self.create_fake_data_fpm()
     cmd = FPScanCommand(self.fpscan_path,
                         ['-c', '-i', stored_path, '--compare-no-match'])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 0
     assert stdout == b'no-match\n'
     assert stderr == b''
Ejemplo n.º 15
0
 def test_scan_ok(self):
     # we can scan fingerprints (emulated)
     out_path = os.path.join(self.home_dir, 'data.fpm')
     cmd = FPScanCommand(self.fpscan_path, ['-s', '-o', out_path])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 0
     assert stdout == b'ok\n'
     assert stderr == b''
     assert os.path.exists(out_path)
Ejemplo n.º 16
0
 def test_scan_fail(self):
     # scans can fail. We respect that
     cmd = FPScanCommand(self.fpscan_path, [
         '-s',
         '--scan-fail',
     ])
     cmd.run()
     ret_code, stdout, stderr = cmd.wait()
     assert cmd.is_alive() is False
     assert ret_code == 1
     assert stdout == b'fail\n'
     assert stderr == b''