Files
dvc/dvc/testing/test_run_cache.py
T
Saugat Pachhai (सौगात) 942a080567 dvc.stage.cache: fix typo, was using src filesystem to transfer
This was working for LocalFileSystem as they work for any directories/path.
It's hard to test this these days, as we don't have remote tests inside
dvc, so it was not caught.

Potentially fixes #7718.
2022-05-23 16:37:40 +03:00

20 lines
527 B
Python

import shutil
from .tmp_dir import TmpDir
def test_push_pull(tmp_dir, dvc, remote):
tmp_dir.gen("foo", "foo")
stage = dvc.stage.add(
deps=["foo"], outs=["bar"], name="copy-foo-bar", cmd="cp foo bar"
)
dvc.reproduce(stage.addressing)
assert dvc.push(run_cache=True) == 2
stage_cache_dir = TmpDir(dvc.stage_cache.cache_dir)
expected = list(stage_cache_dir.rglob("*"))
shutil.rmtree(stage_cache_dir)
dvc.pull(run_cache=True)
assert list(stage_cache_dir.rglob("*")) == expected