Пример #1
0
 def test_detect_scanners_single(self):
     # with scanners available we will get a single entry
     path = os.path.join(self.path_dir, 'fpscan')
     scanner_name = 'Digital Persona U.are.U 4000/4000B/4500\\n'
     scanner_values = '  2 0 1 0 1 384 290\\n'
     open(path, 'w').write('#!%s\nprint("%s%s")\n' %
                           (sys.executable, scanner_name, scanner_values))
     os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC)
     assert detect_scanners(path) == [
         'Digital Persona U.are.U 4000/4000B/4500',
     ]
Пример #2
0
 def test_detect_scanners_single(self):
     # with scanners available we will get a single entry
     path = os.path.join(self.path_dir, 'fpscan')
     scanner_name = 'Digital Persona U.are.U 4000/4000B/4500\\n'
     scanner_values = '  2 0 1 0 1 384 290\\n'
     open(path, 'w').write('#!%s\nprint("%s%s")\n' % (
         sys.executable, scanner_name, scanner_values))
     os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC)
     assert detect_scanners(path) == [
         'Digital Persona U.are.U 4000/4000B/4500',
         ]
Пример #3
0
 def test_detect_scanners_no_scanners(self):
     # with no scanners avail. we will get an empty list
     path = os.path.join(self.path_dir, 'fpscan')
     open(path, 'w').write('#!%s\nprint("0")\n' % sys.executable)
     os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC)
     assert detect_scanners(path) == []
Пример #4
0
 def test_detect_scanners_no_scanners(self):
     # with no scanners avail. we will get an empty list
     path = os.path.join(self.path_dir, 'fpscan')
     open(path, 'w').write('#!%s\nprint("0")\n' % sys.executable)
     os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC)
     assert detect_scanners(path) == []