code: def test_sync_deprecated_runs(
      tmp_path, mocker, capsys, backend, sync_runner
  ):
      # given
      deprecated_unsynced_run = prepare_v0_run(
          path=tmp_path, last_ack_version=1
      )
      offline_old_run = prepare_v0_run(
          path=tmp_path, last_ack_version=None
      )
      get_container_impl = generate_get_metadata_container(
          registered_containers=(
              deprecated_unsynced_run,
              offline_old_run,
          )
      )
  
      # and
      mocker.patch.object(
          backend, "get_metadata_container", get_container_impl
      )
      mocker.patch.object(
          sync_runner,
          "_register_offline_container",
          lambda project, container_type: offline_old_run,
      )
      mocker.patch.object(Operation, "from_dict", lambda x: x)
  
      # when
      sync_runner.sync_all_containers(tmp_path, "foo")
  
      # then
      captured = capsys.readouterr()
      assert captured.err == ""
  
      assert (
          "Offline container {} registered as {}".format(
              f"{offline_old_run.id}",
              get_qualified_name(offline_old_run),
          )
      ) in captured.out
  
      assert (
          "Synchronising {}".format(
              get_qualified_name(deprecated_unsynced_run)
          )
          in captured.out
      )
      assert (
          "Synchronization of run {} completed.".format(
              get_qualified_name(deprecated_unsynced_run)
          )
          in captured.out
      )
      assert (
          "Synchronising {}".format(get_qualified_name(offline_old_run))
          in captured.out
      )
      assert (
          "Synchronization of run {} completed.".format(
              get_qualified_name(offline_old_run)
          )
          in captured.out
      )
  
      # and
      backend.execute_operations.assert_has_calls(
          [
              mocker.call(
                  container_id=deprecated_unsynced_run.id,
                  container_type=ContainerType.RUN,
                  operations=["op-1", "op-2"],
                  operation_storage=mock.ANY,
              ),
              mocker.call(
                  container_id=offline_old_run.id,
                  container_type=ContainerType.RUN,
                  operations=["op-0", "op-1", "op-2"],
                  operation_storage=mock.ANY,
              ),
          ],
          any_order=True,
      )
  
file_path: neptune-client/tests/unit/neptune/new/cli/test_sync.py
imports: from unittest.mock import MagicMock
  import mock
  import pytest
  from neptune.cli.sync import SyncRunner
  from neptune.cli.utils import get_qualified_name
  from neptune.internal.container_type import ContainerType
  from neptune.internal.operation import Operation
  from tests.unit.neptune.new.cli.utils import execute_operations, generate_get_metadata_container, prepare_v0_run, prepare_v1_container
label_desc: Use image node_id 6 for calling a global function with example usage: test_sync_deprecated_runs(tmp_path, mocker, capsys, backend, sync_runner) without return types