Exemplo n.º 1
0
 def is_compatible(cls, upload_source):
     return readable(upload_source) and seekable(upload_source)
 def test_non_seekable_oserror(self):
     # Should return False if OSError is thrown.
     with open(self.filename, 'w') as f:
         self.assertFalse(seekable(ErrorRaisingSeekWrapper(f, OSError())))
 def test_seekable_fileobj(self):
     with open(self.filename, 'w') as f:
         self.assertTrue(seekable(f))
 def test_non_file_like_obj(self):
     # Fails becase there is no seekable(), seek(), nor tell()
     self.assertFalse(seekable(object()))
Exemplo n.º 5
0
 def is_compatible(cls, download_target, osutil):
     return seekable(download_target)