code: def test_push_order(
      tmp_dir, dvc, tmp_path_factory, mocker, local_remote
  ):
      from dvc_objects.fs import generic
  
      foo = tmp_dir.dvc_gen({"foo": {"bar": "bar content"}})[0].outs[0]
      tmp_dir.dvc_gen({"baz": "baz content"})
  
      mocked_upload = mocker.spy(generic, "transfer")
      dvc.push()
  
      # foo .dir file should be uploaded after bar
      odb = dvc.cloud.get_remote_odb("upstream")
      foo_path = odb.oid_to_path(foo.hash_info.value)
      bar_path = odb.oid_to_path(foo.obj._trie[("bar",)][1].value)
      paths = list(
          itertools.chain.from_iterable(
              args[3] for args, _ in mocked_upload.call_args_list
          )
      )
      assert paths.index(foo_path) > paths.index(bar_path)
  
imports: import errno
  import itertools
  import os
  import stat
  import configobj
  import pytest
  from dvc.cli import main
  from dvc.config import Config
  from dvc.exceptions import DownloadError, UploadError
  from dvc.utils.fs import remove
label_desc: Use image node_id 15 for calling a global function with example usage: test_push_order(tmp_dir, dvc, tmp_path_factory, mocker, local_remote) without return types