mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
In all operations we're dealing with a single stream, so there is no good reason to process targets in parallel as they all use the same resource to pull\push data to. Signed-off-by: Ruslan Kuprieiev <[email protected]>
29 lines
605 B
Python
29 lines
605 B
Python
import os
|
|
import shutil
|
|
import filecmp
|
|
|
|
from dvc import utils
|
|
from tests.basic_env import TestDvc
|
|
|
|
|
|
class TestUtils(TestDvc):
|
|
def test_copyfile(self):
|
|
src = 'file1'
|
|
dest = 'file2'
|
|
dest_dir = 'testdir'
|
|
|
|
with open(src, 'w+') as f:
|
|
f.write('file1contents')
|
|
|
|
os.mkdir(dest_dir)
|
|
|
|
utils.copyfile(src, dest)
|
|
self.assertTrue(filecmp.cmp(src, dest))
|
|
|
|
utils.copyfile(src, dest_dir)
|
|
self.assertTrue(filecmp.cmp(src, '{}/{}'.format(dest_dir, src)))
|
|
|
|
shutil.rmtree(dest_dir)
|
|
os.remove(src)
|
|
os.remove(dest)
|