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

Function test_fetch

tests/unit/test_updater.py:37–52  ·  view source on GitHub ↗
(mocker, updater)

Source from the content-addressed store, hash-verified

35
36
37def test_fetch(mocker, updater):
38 mock_get = mocker.patch("requests.get")
39 mock_get.return_value.status_code = 200
40 mock_get.return_value.json.return_value = {"version": __version__}
41
42 assert not os.path.exists(updater.updater_file)
43
44 updater.fetch(detach=False)
45
46 mock_get.assert_called_once_with(Updater.URL, timeout=Updater.TIMEOUT_GET)
47 assert os.path.isfile(updater.updater_file)
48
49 with open(updater.updater_file, encoding="utf-8") as fobj:
50 info = json.load(fobj)
51
52 assert info["version"] == __version__
53
54
55@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 5

openFunction · 0.85
fetchMethod · 0.80
isfileMethod · 0.80
existsMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected