test: do not use repo template in erepo_dir

This commit is contained in:
Alexander Schepanovski
2020-01-04 10:47:13 +07:00
parent b194bfa1ff
commit 5dd2d7b192
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -276,7 +276,7 @@ def erepo_dir(tmp_path_factory, monkeypatch):
_git_init()
path.dvc = Repo.init()
path.scm = path.dvc.scm
path.dvc_gen(REPO_TEMPLATE, commit="init repo")
path.scm.commit("init dvc")
rconfig = RemoteConfig(path.dvc.config)
rconfig.add("upstream", path.dvc.cache.local.cache_dir, default=True)
+5 -3
View File
@@ -30,17 +30,19 @@ def run_dvc(*argv):
@pytest.mark.parametrize("remote_url", remote_params, indirect=True)
def test_get_url(remote_url, tmp_dir, dvc, repo_template):
def test_get_url(tmp_dir, dvc, remote_url):
run_dvc("remote", "add", "-d", "upstream", remote_url)
dvc.add("foo")
tmp_dir.dvc_gen("foo", "foo")
expected_url = URLInfo(remote_url) / "ac/bd18db4cc2f85cedef654fccc4a4d8"
assert api.get_url("foo") == expected_url
@pytest.mark.parametrize("remote_url", remote_params, indirect=True)
def test_get_url_external(remote_url, erepo_dir):
def test_get_url_external(erepo_dir, remote_url):
_set_remote_url_and_commit(erepo_dir.dvc, remote_url)
with erepo_dir.chdir():
erepo_dir.dvc_gen("foo", "foo", commit="add foo")
# Using file url to force clone to tmp repo
repo_url = "file://{}".format(erepo_dir)