Files
dvc/tests/test_utils.py
T
Ruslan Kuprieiev 61b469144e cloud: process targets one-by-one
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]>
2018-02-17 19:36:51 +02:00

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)