code: def test_fetch_asset_version_with_storage_provider(
      version_asset_name, version, versioning, working_dir
  ):
      manager = AssetsManager(
          assets_dir=working_dir,
          storage_provider=StorageProvider(
              provider="local",
              bucket=os.path.join(TEST_DIR, "testdata", "test-bucket"),
              prefix="assets-prefix",
          ),
      )
  
      asset_name = os.path.join("category", version_asset_name)
      spec = AssetSpec(
          name=asset_name, version=version, versioning=versioning
      )
  
      # no _has_succeeded cache => fetch
      asset_dict = manager._fetch_asset_version(
          spec=spec,
          _force_download=False,
      )
  
      del asset_dict["meta"]  #  fetch meta data
      assert asset_dict == {
          "from_cache": False,
          "version": version,
          "path": os.path.join(working_dir, asset_name, version),
      }
  
      #  cache
      asset_dict = manager._fetch_asset_version(
          spec=spec,
          _force_download=False,
      )
  
      assert asset_dict == {
          "from_cache": True,
          "version": version,
          "path": os.path.join(working_dir, asset_name, version),
      }
  
      #  cache but force download
      asset_dict = manager._fetch_asset_version(
          spec=spec,
          _force_download=True,
      )
  
      del asset_dict["meta"]  #  fetch meta data
      assert asset_dict == {
          "from_cache": False,
          "version": version,
          "path": os.path.join(working_dir, asset_name, version),
      }
  
      # Re-Download asset when missing version
      os.remove(os.path.join(working_dir, asset_name, version))
      asset_dict = manager._fetch_asset_version(
          spec=spec,
          _force_download=False,
      )
  
      del asset_dict["meta"]  #  fetch meta data
      assert asset_dict == {
          "from_cache": False,
          "version": version,
          "path": os.path.join(working_dir, asset_name, version),
      }
  
file_path: modelkit/tests/assets/test_local_manager.py
imports: import os
  import shutil
  import stat
  import pytest
  from modelkit.assets import errors
  from modelkit.assets.manager import AssetsManager, _fetch_local_version
  from modelkit.assets.remote import StorageProvider
  from modelkit.assets.settings import AssetSpec
  from tests import TEST_DIR
  from tests.assets.test_versioning import test_versioning
label_desc: Use image node_id 7 for calling a global function with example usage: test_fetch_asset_version_with_storage_provider(version_asset_name, version, versioning, working_dir) without return types