tests: fix tests on travis

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2019-02-07 08:43:43 +02:00
parent 92d4acc978
commit c95e6eb856
3 changed files with 18 additions and 5 deletions
+10 -4
View File
@@ -742,8 +742,14 @@ class TestCheckSumRecalculation(TestDvc):
test_collect = spy(State._collect)
with patch.object(State, "_collect", test_collect):
url = get_local_url()
main(["remote", "add", "-d", TEST_REMOTE, url])
main(["add", self.FOO])
main(["push"])
main(["run", "-d", self.FOO, "echo foo"])
ret = main(["remote", "add", "-d", TEST_REMOTE, url])
self.assertEqual(ret, 0)
ret = main(["config", "cache.type", "hardlink"])
self.assertEqual(ret, 0)
ret = main(["add", self.FOO])
self.assertEqual(ret, 0)
ret = main(["push"])
self.assertEqual(ret, 0)
ret = main(["run", "-d", self.FOO, "echo foo"])
self.assertEqual(ret, 0)
self.assertEqual(test_collect.mock.call_count, 1)
+1 -1
View File
@@ -79,7 +79,7 @@ class TestInterruptedDownload(TestDvc):
import_url = urljoin(self.remote, self.FOO)
import_output = "imported_file"
tmp_file_name = import_output + ".part"
tmp_file_path = os.path.join(self._root_dir, tmp_file_name)
tmp_file_path = os.path.realpath(os.path.join(self._root_dir, tmp_file_name))
self._import_with_interrupt(import_output, import_url)
self.assertTrue(os.path.exists(tmp_file_name))
self.assertFalse(os.path.exists(import_output))
+7
View File
@@ -840,6 +840,8 @@ class TestReproExternalBase(TestDvc):
self.assertEqual(ret, 0)
ret = main(["remote", "add", "myrepo", cache])
self.assertEqual(ret, 0)
ret = main(["remote", "modify", "myrepo", "type", "hardlink"])
self.assertEqual(ret, 0)
remote_name = "myremote"
remote_key = str(uuid.uuid4())
@@ -849,6 +851,8 @@ class TestReproExternalBase(TestDvc):
ret = main(["remote", "add", remote_name, remote])
self.assertEqual(ret, 0)
ret = main(["remote", "modify", remote_name, "type", "hardlink"])
self.assertEqual(ret, 0)
self.dvc = Project(".")
@@ -1088,6 +1092,9 @@ class TestReproExternalLOCAL(TestReproExternalBase):
def setUp(self):
super(TestReproExternalLOCAL, self).setUp()
self.tmpdir = TestDvc.mkdtemp()
ret = main(["config", "cache.type", "hardlink"])
self.assertEqual(ret, 0)
self.dvc = Project(".")
def should_test(self):
return True