(tmp_dir, scm, dvc, run_copy, remove_outs)
| 13 | |
| 14 | @pytest.mark.parametrize("remove_outs", [True, False]) |
| 15 | def test_remove(tmp_dir, scm, dvc, run_copy, remove_outs): |
| 16 | (stage1,) = tmp_dir.dvc_gen("foo", "foo") |
| 17 | stage2 = run_copy("foo", "bar", name="copy-foo-bar") |
| 18 | stage3 = run_copy("bar", "foobar", name="copy-bar-foobar") |
| 19 | |
| 20 | assert "/foo" in get_gitignore_content() |
| 21 | assert "/bar" in get_gitignore_content() |
| 22 | assert "/foobar" in get_gitignore_content() |
| 23 | |
| 24 | for stage in [stage1, stage2, stage3]: |
| 25 | dvc.remove(stage.addressing, outs=remove_outs) |
| 26 | out_exists = (out.exists for out in stage.outs) |
| 27 | assert stage not in dvc.index.stages |
| 28 | if remove_outs: |
| 29 | assert not any(out_exists) |
| 30 | else: |
| 31 | assert all(out_exists) |
| 32 | |
| 33 | assert not (tmp_dir / ".gitignore").exists() |
| 34 | |
| 35 | |
| 36 | def test_remove_file_target(tmp_dir, dvc): |
nothing calls this directly
no test coverage detected