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

Function test_missing_cache

tests/func/test_data_cloud.py:163–192  ·  view source on GitHub ↗
(tmp_dir, dvc, local_remote, caplog)

Source from the content-addressed store, hash-verified

161
162
163def test_missing_cache(tmp_dir, dvc, local_remote, caplog):
164 tmp_dir.dvc_gen({"foo": "foo", "bar": "bar"})
165
166 # purge cache
167 dvc.cache.local.clear()
168
169 header = (
170 "Some of the cache files do not exist "
171 "neither locally nor on remote. Missing cache files:\n"
172 )
173 foo = "md5: 37b51d194a7513e45b56f6524f2d51f2\n"
174 bar = "md5: acbd18db4cc2f85cedef654fccc4a4d8\n"
175
176 caplog.clear()
177 dvc.push()
178 assert header in caplog.text
179 assert foo in caplog.text
180 assert bar in caplog.text
181
182 caplog.clear()
183 dvc.fetch()
184 assert header in caplog.text
185 assert foo in caplog.text
186 assert bar in caplog.text
187
188 caplog.clear()
189 assert dvc.status(cloud=True) == {"bar": "missing", "foo": "missing"}
190 assert header not in caplog.text
191 assert foo not in caplog.text
192 assert bar not in caplog.text
193
194
195def test_verify_hashes(tmp_dir, scm, dvc, mocker, tmp_path_factory, local_remote):

Callers

nothing calls this directly

Calls 5

dvc_genMethod · 0.80
fetchMethod · 0.80
clearMethod · 0.45
pushMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected