mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
add: remove file (#9548)
* add: remove `file` Follow up to #9547. * Update add.py * fix tests
This commit is contained in:
@@ -645,10 +645,10 @@ def test_add_from_data_dir(tmp_dir, scm, dvc):
|
||||
def test_add_parent_dir(tmp_dir, scm, dvc):
|
||||
tmp_dir.gen({"dir": {"file1": "file1 content"}})
|
||||
out_path = os.path.join("dir", "file1")
|
||||
dvc.add(out_path, file=out_path + ".dvc")
|
||||
dvc.add(out_path)
|
||||
|
||||
with pytest.raises(OverlappingOutputPathsError) as e:
|
||||
dvc.add("dir", file="dir.dvc")
|
||||
dvc.add("dir")
|
||||
assert str(e.value) == (
|
||||
"Cannot add 'dir', because it is overlapping with other DVC "
|
||||
"tracked output: '{out}'.\n"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import shutil
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
@@ -138,10 +139,10 @@ def test_move_should_save_stage_info(tmp_dir, dvc):
|
||||
|
||||
|
||||
def test_should_move_to_dir_on_non_default_stage_file(tmp_dir, dvc):
|
||||
stage_file_name = "stage.dvc"
|
||||
tmp_dir.gen({"file": "file_content"})
|
||||
|
||||
dvc.add("file", file=stage_file_name)
|
||||
dvc.add("file")
|
||||
shutil.move("file.dvc", "stage.dvc")
|
||||
os.mkdir("directory")
|
||||
|
||||
dvc.move("file", "directory")
|
||||
|
||||
Reference in New Issue
Block a user