code: def test_upgrade_checkpoint_single_file(
      migrate_mock, load_mock, save_mock, tmp_path
  ):
      file = tmp_path / "checkpoint.ckpt"
      file.touch()
      with mock.patch("sys.argv", ["upgrade_checkpoint.py", str(file)]):
          upgrade_main()
  
      load_mock.assert_called_once_with(Path(file), map_location=None)
      migrate_mock.assert_called_once()
      save_mock.assert_called_once_with(ANY, Path(file))
  
file_path: pytorch-lightning/tests/tests_pytorch/utilities/test_upgrade_checkpoint.py
imports: import logging
  from pathlib import Path
  from unittest import mock
  from unittest.mock import ANY
  import pytest
  import torch
  from lightning.pytorch.utilities.upgrade_checkpoint import main
label_desc: Use image node_id 2 for calling a global function with example usage: test_upgrade_checkpoint_single_file(migrate_mock, load_mock, save_mock, tmp_path) without return types