From c95e6eb8564bf54d726467fd0d3f6f9ad6b48624 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Thu, 7 Feb 2019 08:43:43 +0200 Subject: [PATCH] tests: fix tests on travis Signed-off-by: Ruslan Kuprieiev --- tests/test_data_cloud.py | 14 ++++++++++---- tests/test_import.py | 2 +- tests/test_repro.py | 7 +++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/test_data_cloud.py b/tests/test_data_cloud.py index 5bd914b5a..baf3a938a 100644 --- a/tests/test_data_cloud.py +++ b/tests/test_data_cloud.py @@ -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) diff --git a/tests/test_import.py b/tests/test_import.py index 5fc3c2799..2a82ab263 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -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)) diff --git a/tests/test_repro.py b/tests/test_repro.py index 9eee2f4b0..3675fd5a1 100644 --- a/tests/test_repro.py +++ b/tests/test_repro.py @@ -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