MCPcopy
hub / github.com/treeverse/dvc / test_open

Method test_open

dvc/testing/api_tests.py:18–29  ·  view source on GitHub ↗
(self, tmp_dir, dvc, remote)

Source from the content-addressed store, hash-verified

16 assert api.get_url("foo") == expected_url
17
18 def test_open(self, tmp_dir, dvc, remote):
19 tmp_dir.dvc_gen({"foo": "foo-text", "dir": {"bar": "bar-text"}})
20 dvc.push()
21
22 # Remove cache to force download
23 remove(dvc.cache.local.path)
24
25 with api.open("foo") as fobj:
26 assert fobj.read() == "foo-text"
27
28 with api.open("dir/bar") as fobj:
29 assert fobj.read() == "bar-text"
30
31 @pytest.mark.parametrize("clear_cache", [True, False], ids=["cache", "no_cache"])
32 @pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

removeFunction · 0.90
dvc_genMethod · 0.80
openMethod · 0.80
pushMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected