code: def test_log_artifact_reuse_ftp_client(ftp_mock, tmp_path):
      repo = FTPArtifactRepository("ftp://test_ftp/some/path")
  
      repo.get_ftp_client = MagicMock()
      call_mock = MagicMock(return_value=ftp_mock)
      repo.get_ftp_client.return_value = MagicMock(__enter__=call_mock)
  
      d = tmp_path.joinpath("data")
      d.mkdir()
      file = d.joinpath("test.txt")
      file.write_text("hello world!")
      fpath = str(file)
  
      repo.log_artifact(fpath)
      repo.log_artifact(fpath, "subdir1/subdir2")
      repo.log_artifact(fpath, "subdir3")
  
      assert repo.get_ftp_client.call_count == 3
  
imports: import ftplib
  import posixpath
  from ftplib import FTP
  from unittest.mock import MagicMock
  import pytest
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.ftp_artifact_repo import FTPArtifactRepository
label_desc: Use image node_id 14 for calling a global function with example usage: test_log_artifact_reuse_ftp_client(ftp_mock, tmp_path) without return types