Merge pull request #843 from efiop/master

Misc tests
This commit is contained in:
Ruslan Kuprieiev
2018-07-01 21:09:52 +03:00
committed by GitHub
5 changed files with 35 additions and 4 deletions
+1 -1
View File
@@ -304,7 +304,7 @@ class RemoteLOCAL(RemoteBase):
copyfile(path_info['path'], tmp_file, no_progress_bar=no_progress_bar, name=name)
except Exception as exc:
Logger.error("Failed to download '{}' to '{}'".format(path_info['path'], path), exc)
return
continue
os.rename(tmp_file, path)
+6 -2
View File
@@ -37,8 +37,12 @@ class TestCheckout(TestRepro):
class TestCheckoutSingleStage(TestCheckout):
def test(self):
self.dvc.checkout(self.foo_stage.path)
self.dvc.checkout(self.data_dir_stage.path)
ret = main(['checkout', self.foo_stage.path])
self.assertEqual(ret, 0)
ret = main(['checkout', self.data_dir_stage.path])
self.assertEqual(ret, 0)
self._test_checkout()
+4
View File
@@ -18,6 +18,10 @@ class TestConfigCLI(TestDvc):
return True
def test_root(self):
ret = main(['root'])
self.assertEqual(ret, 0)
def test(self):
section = 'setsection'
field = 'setfield'
+20
View File
@@ -0,0 +1,20 @@
import os
import stat
import shutil
import filecmp
from dvc.main import main
from dvc.command.imp import CmdImport
from tests.basic_env import TestDvc
class TestCmdImport(TestDvc):
def test(self):
ret = main(['import',
self.FOO, 'import'])
self.assertEqual(ret, 0)
ret = main(['import',
'non-existing-file', 'import'])
self.assertNotEqual(ret, 0)
+4 -1
View File
@@ -5,11 +5,14 @@ from dvc.main import main
from tests.basic_env import TestDvc
class TestInit(TestDvc):
class TestInstall(TestDvc):
def test(self):
ret = main(['install'])
self.assertEqual(ret, 0)
ret = main(['install'])
self.assertNotEqual(ret, 0)
self.assertTrue(os.path.isfile('.git/hooks/post-checkout'))
self.dvc.add(self.FOO)