|
1 | | -import filecmp |
2 | 1 | import re |
3 | 2 | import os |
4 | 3 |
|
5 | 4 | import pytest |
6 | 5 |
|
7 | 6 | from dvc.path_info import PathInfo |
8 | | -from dvc.utils import copyfile |
9 | 7 | from dvc.utils import file_md5 |
10 | 8 | from dvc.utils import fix_env |
11 | 9 | from dvc.utils import relpath |
12 | 10 | from dvc.utils import to_chunks |
13 | 11 | from dvc.utils import tmp_fname |
14 | 12 | from dvc.utils import walk_files |
15 | | -from tests.basic_env import TestDir |
16 | 13 |
|
17 | 14 |
|
18 | 15 | @pytest.mark.parametrize( |
@@ -88,32 +85,6 @@ def test_file_md5(repo_dir): |
88 | 85 | assert file_md5(fname) == file_md5(fname_object) |
89 | 86 |
|
90 | 87 |
|
91 | | -@pytest.mark.parametrize("path", [TestDir.DATA, TestDir.DATA_DIR]) |
92 | | -def test_copyfile(path, repo_dir): |
93 | | - src = repo_dir.FOO |
94 | | - dest = path |
95 | | - src_info = PathInfo(repo_dir.BAR) |
96 | | - dest_info = PathInfo(path) |
97 | | - |
98 | | - copyfile(src, dest) |
99 | | - if os.path.isdir(dest): |
100 | | - assert filecmp.cmp( |
101 | | - src, os.path.join(dest, os.path.basename(src)), shallow=False |
102 | | - ) |
103 | | - else: |
104 | | - assert filecmp.cmp(src, dest, shallow=False) |
105 | | - |
106 | | - copyfile(src_info, dest_info) |
107 | | - if os.path.isdir(dest_info.fspath): |
108 | | - assert filecmp.cmp( |
109 | | - src_info.fspath, |
110 | | - os.path.join(dest_info.fspath, os.path.basename(src_info.fspath)), |
111 | | - shallow=False, |
112 | | - ) |
113 | | - else: |
114 | | - assert filecmp.cmp(src_info.fspath, dest_info.fspath, shallow=False) |
115 | | - |
116 | | - |
117 | 88 | def test_tmp_fname(): |
118 | 89 | file_path = os.path.join("path", "to", "file") |
119 | 90 | file_path_info = PathInfo(file_path) |
|
0 commit comments