code: def test_migrate_one(td):
      src = pjoin(td, "src")
      srcdir = pjoin(td, "srcdir")
      dst = pjoin(td, "dst")
      dstdir = pjoin(td, "dstdir")
  
      touch(src, "test file")
      touch(pjoin(srcdir, "f"), "test dir file")
  
      called = {}
  
      def notice_m_file(src, dst):
          called["migrate_file"] = True
          return migrate_file(src, dst)
  
      def notice_m_dir(src, dst):
          called["migrate_dir"] = True
          return migrate_dir(src, dst)
  
      with patch.object(
          migrate_mod, "migrate_file", notice_m_file
      ), patch.object(migrate_mod, "migrate_dir", notice_m_dir):
          assert migrate_one(src, dst)
          assert called == {"migrate_file": True}
          called.clear()
          assert migrate_one(srcdir, dstdir)
          assert called == {"migrate_dir": True}
          called.clear()
          assert not migrate_one(pjoin(td, "does_not_exist"), dst)
          assert called == {}
  
imports: from __future__ import annotations
  import os
  import re
  import shutil
  from tempfile import mkdtemp
  from unittest.mock import patch
  import pytest
  from jupyter_core import migrate
  from jupyter_core.application import JupyterApp
  from jupyter_core.migrate import migrate, migrate_config, migrate_dir, migrate_file, migrate_one, migrate_static_custom
  from jupyter_core.utils import ensure_dir_exists
label_desc: Use image node_id 7 for calling a global function with example usage: test_migrate_one(td) and returns: migrate_file, migrate_dir