code: def test_list_artifacts(mock_client):
      artifact_root_path = "/experiment_id/run_id/"
      repo = GCSArtifactRepository(
          "gs://test_bucket" + artifact_root_path, client=mock_client
      )
  
      # mocked bucket/blob structure
      # gs://test_bucket/experiment_id/run_id/
      #  |- file
      #  |- model
      #     |- model.pb
  
      # mocking a single blob returned by bucket.list_blobs iterator
      # https://googlecloudplatform.github.io/google-cloud-python/latest/storage/buckets.html#google.cloud.storage.bucket.Bucket.list_blobs
  
      # list artifacts at artifact root level
      obj_mock = mock.Mock()
      file_path = "file"
      obj_mock.configure_mock(
          name=artifact_root_path + file_path, size=1
      )
  
      dir_mock = mock.Mock()
      dir_name = "model"
      dir_mock.configure_mock(
          prefixes=(artifact_root_path + dir_name + "/",)
      )
  
      mock_results = mock.MagicMock()
      mock_results.configure_mock(pages=[dir_mock])
      mock_results.__iter__.return_value = [obj_mock]
  
      mock_client.bucket.return_value.list_blobs.return_value = (
          mock_results
      )
  
      artifacts = repo.list_artifacts(path=None)
  
      assert len(artifacts) == 2
      assert artifacts[0].path == file_path
      assert artifacts[0].is_dir is False
      assert artifacts[0].file_size == obj_mock.size
      assert artifacts[1].path == dir_name
      assert artifacts[1].is_dir is True
      assert artifacts[1].file_size is None
  
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 5 for calling a global function with example usage: test_list_artifacts(mock_client) without return types