def make_test_file(path, size): if size is None: os.makedirs(path) else: head, tail = os.path.split(path) if not os.path.isdir(head): os.makedirs(head) write_random_file(path, size)
def test_download(self, syncer, temp_dir): local_file = os.path.join(temp_dir, 'up') local_file_downloaded = os.path.join(temp_dir, 'down') remote_file = 'omniSyncTest' + random_string(10) write_random_file(local_file, 100) syncer.upload(local=local_file, remote=remote_file) syncer.download(local=local_file_downloaded, remote=remote_file) assert filecmp.cmp(local_file, local_file_downloaded)