(tmp_dir, dvc, tmp_path_factory, mocker, local_remote)
| 276 | |
| 277 | |
| 278 | def 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 | |
| 299 | def test_remote_modify_validation(dvc): |
nothing calls this directly
no test coverage detected