コード例 #1
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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'
コード例 #2
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #3
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #4
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #5
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #6
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #7
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #8
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #9
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #10
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #11
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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'
コード例 #12
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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)
コード例 #13
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #14
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''
コード例 #15
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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)
コード例 #16
0
ファイル: test_app.py プロジェクト: WAeUP/waeup.identifier
 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''