From 39f010e50aecb85465ff7f5601f6b9ec7bdfb31d Mon Sep 17 00:00:00 2001 From: pawel Date: Mon, 30 Dec 2019 16:16:37 +0100 Subject: [PATCH] api: open: fix open scm controlled test --- tests/func/test_api.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/func/test_api.py b/tests/func/test_api.py index 4c21c5531..4f405a85b 100644 --- a/tests/func/test_api.py +++ b/tests/func/test_api.py @@ -100,15 +100,16 @@ def _set_remote_url_and_commit(repo, remote_url): repo.scm.commit("modify remote") -# FIXME: this test doesn't use scm ;D -def test_open_scm_controlled(dvc_repo, repo_dir): - stage, = dvc_repo.add(repo_dir.FOO) +def test_open_scm_controlled(tmp_dir, scm, dvc): + tmp_dir.scm_gen({"scm_controlled": "file content"}, commit="create file") - stage_content = open(stage.path, "r").read() - with api.open(stage.path) as fd: - assert fd.read() == stage_content + with api.open("scm_controlled") as fd: + assert fd.read() == "file content" +# def test_open_not_cached2(tmp_dir, scm, dvc): +# tmp_dir.dvc_gen({"file": "file content"}) + # TODO: simplify, we shouldn't need run. def test_open_not_cached(dvc): metric_file = "metric.txt"