Skip to content

Commit

Permalink
Merge pull request #3044 from pared/2896_api
Browse files Browse the repository at this point in the history
tests: api: convert to dir helpers
  • Loading branch information
efiop authored Jan 6, 2020
2 parents 0ad3548 + af42531 commit 8041d70
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/func/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from dvc import api
from dvc.api import SummonError
from dvc.compat import fspath
from dvc.exceptions import FileMissingError
from dvc.main import main
from dvc.path_info import URLInfo
Expand Down Expand Up @@ -106,16 +107,13 @@ 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, erepo_dir):
erepo_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", repo=fspath(erepo_dir)) as fd:
assert fd.read() == "file content"


# TODO: simplify, we shouldn't need run.
def test_open_not_cached(dvc):
metric_file = "metric.txt"
metric_content = "0.6"
Expand Down

0 comments on commit 8041d70

Please sign in to comment.