code: def test_log_artifact(mock_client, tmp_path):
      repo = GCSArtifactRepository(
          "gs://test_bucket/some/path", mock_client
      )
  
      d = tmp_path.joinpath("data")
      d.mkdir()
      f = d.joinpath("test.txt")
      f.write_text("hello world!")
      fpath = d.joinpath("test.txt")
      fpath = str(fpath)
  
      # This will call isfile on the code path being used,
      # thus testing that it's being called with an actually file path
      def custom_isfile(*args, **kwargs):
          if args:
              return os.path.isfile(args[0])
          return os.path.isfile(kwargs.get("filename"))
  
      mock_method_chain(
          mock_client,
          [
              "bucket",
              "blob",
              "upload_from_filename",
          ],
          side_effect=custom_isfile,
      )
      repo.log_artifact(fpath)
  
      mock_client.bucket.assert_called_with("test_bucket")
      mock_client.bucket().blob.assert_called_with(
          "some/path/test.txt", chunk_size=repo._GCS_UPLOAD_CHUNK_SIZE
      )
      mock_client.bucket().blob().upload_from_filename.assert_called_with(
          fpath, timeout=repo._GCS_DEFAULT_TIMEOUT
      )
  
imports: import os
  import posixpath
  from unittest import mock
  import pytest
  import requests
  from google.auth.exceptions import DefaultCredentialsError
  from google.cloud.storage import client
  from mlflow.entities.multipart_upload import MultipartUploadPart
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.gcs_artifact_repo import GCSArtifactRepository, GCSMPUArguments
  from tests.helper_functions import mock_method_chain
label_desc: Use image node_id 7 for calling a global function with example usage: test_log_artifact(mock_client, tmp_path) and returns: os, os