File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 77
88from dvc import api
99from dvc .api import SummonError
10+ from dvc .compat import fspath
1011from dvc .exceptions import FileMissingError
1112from dvc .main import main
1213from dvc .path_info import URLInfo
@@ -106,16 +107,13 @@ def _set_remote_url_and_commit(repo, remote_url):
106107 repo .scm .commit ("modify remote" )
107108
108109
109- # FIXME: this test doesn't use scm ;D
110- def test_open_scm_controlled (dvc_repo , repo_dir ):
111- stage , = dvc_repo .add (repo_dir .FOO )
110+ def test_open_scm_controlled (tmp_dir , erepo_dir ):
111+ erepo_dir .scm_gen ({"scm_controlled" : "file content" }, commit = "create file" )
112112
113- stage_content = open (stage .path , "r" ).read ()
114- with api .open (stage .path ) as fd :
115- assert fd .read () == stage_content
113+ with api .open ("scm_controlled" , repo = fspath (erepo_dir )) as fd :
114+ assert fd .read () == "file content"
116115
117116
118- # TODO: simplify, we shouldn't need run.
119117def test_open_not_cached (dvc ):
120118 metric_file = "metric.txt"
121119 metric_content = "0.6"
You can’t perform that action at this time.
0 commit comments