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

Function test_push_order

tests/func/test_remote.py:278–296  ·  view source on GitHub ↗
(tmp_dir, dvc, tmp_path_factory, mocker, local_remote)

Source from the content-addressed store, hash-verified

276
277
278def test_push_order(tmp_dir, dvc, tmp_path_factory, mocker, local_remote):
279 from dvc_objects.fs import generic
280
281 foo = tmp_dir.dvc_gen({"foo": {"bar": "bar content"}})[0].outs[0]
282 tmp_dir.dvc_gen({"baz": "baz content"})
283
284 mocked_upload = mocker.spy(generic, "transfer")
285 dvc.push()
286
287 # foo .dir file should be uploaded after bar
288 odb = dvc.cloud.get_remote_odb("upstream")
289 foo_path = odb.oid_to_path(foo.hash_info.value)
290 bar_path = odb.oid_to_path(foo.obj._trie[("bar",)][1].value)
291 paths = list(
292 itertools.chain.from_iterable(
293 args[3] for args, _ in mocked_upload.call_args_list
294 )
295 )
296 assert paths.index(foo_path) > paths.index(bar_path)
297
298
299def test_remote_modify_validation(dvc):

Callers

nothing calls this directly

Calls 5

dvc_genMethod · 0.80
get_remote_odbMethod · 0.80
oid_to_pathMethod · 0.80
pushMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected