Esempio n. 1
0
 def test_hash(self):
     fname = generate_file(200000)
     self.addCleanup(os.unlink, fname)
     filehash = thesubdb.get_hash(fname)
     self.assertEquals(filehash, '7670cc52c96414e1f6c29cbbb6b422b5')
Esempio n. 2
0
 def test_hash(self):
     fname = generate_file(200000)
     self.addCleanup(os.unlink, fname)
     filehash = thesubdb.get_hash(fname)
     self.assertEquals(filehash, '7670cc52c96414e1f6c29cbbb6b422b5')
 def test_hash_file_too_small(self):
     fname = generate_file(50000)
     self.addCleanup(os.unlink, fname)
     with self.assertRaises(SourceError):
         opensubtitles.hash_size_file(fname)
 def test_hash(self):
     fname = generate_file(200000)
     self.addCleanup(os.unlink, fname)
     filehash, size = opensubtitles.hash_size_file(fname)
     self.assertEquals(filehash, '4d494e534f4e473f')
     self.assertEquals(size, 200000)
 def test_hash_file_too_small(self):
     fname = generate_file(50000)
     self.addCleanup(os.unlink, fname)
     with self.assertRaises(SourceError):
         opensubtitles.hash_size_file(fname)
 def test_hash(self):
     fname = generate_file(200000)
     self.addCleanup(os.unlink, fname)
     filehash, size = opensubtitles.hash_size_file(fname)
     self.assertEquals(filehash, '4d494e534f4e473f')
     self.assertEquals(size, 200000)