def test_sync_from_dir_noop_local(self): path = os.path.join(self.tmp_dir.name, 'lorem', 'ipsum.txt') src = os.path.join(self.tmp_dir.name, 'lorem') make_dir(src, check_empty=False) fs = FileSystem.get_file_system(src, 'r') fs.write_bytes(path, bytes([0x00, 0x01])) sync_from_dir(src, src, delete=True) self.assertEqual(len(list_paths(src)), 1)
def sync_from_cloud(self): """Sync any previous output in the cloud to output_dir.""" if self.cfg.output_uri.startswith('s3://'): sync_from_dir(self.cfg.output_uri, self.output_dir)
def test_sync_from_http(self): src = 'http://localhost/' dst = self.tmp_dir.name self.assertRaises(NotReadableError, lambda: sync_from_dir(src, dst))