Logo Search packages:      
Sourcecode: jbig2dec version File versions  Download package

def test_jbig2dec::KnownFileHash::runTest (   self )
jbig2dec should return proper document hashes for known files

Reimplemented from test_jbig2dec::SelfTest.

Definition at line 160 of file test_jbig2dec.py.

    '''jbig2dec should return proper document hashes for known files'''
    # invoke jbig2dec on our file
    instance = os.popen('./jbig2dec -q -o /dev/null --hash ' + self.file)
    lines = instance.readlines()
    exit_code = instance.close()
    self.failIf(exit_code, 'jbig2dec should exit normally')
    # test here for correct hash
    hash_pattern = re.compile('[0-9a-f]{%d}' % len(decode_hash))
    for line in lines:
      m = hash_pattern.search(line.lower())
      if m:
        self.assertEqual(self.decode_hash, m.group(),
          'hash of known decoded document must be correct')
    self.fail('document hash was not found in the output')

Generated by  Doxygen 1.6.0   Back to index