From 5dd2d7b192097746f92b72f6ed5c435130095c25 Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Fri, 3 Jan 2020 17:31:46 +0700 Subject: [PATCH] test: do not use repo template in erepo_dir --- tests/dir_helpers.py | 2 +- tests/func/test_api.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/dir_helpers.py b/tests/dir_helpers.py index 4b374e26a..cd001c002 100644 --- a/tests/dir_helpers.py +++ b/tests/dir_helpers.py @@ -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) diff --git a/tests/func/test_api.py b/tests/func/test_api.py index 84f02c4a1..990e58d8c 100644 --- a/tests/func/test_api.py +++ b/tests/func/test_api.py @@ -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)