code: def test_caches_result_on_success(
      self,
      store_file: "StoreFileFixture",
      api,
      example_file: Path,
      artifact_file_cache: ArtifactFileCache,
      err: Optional[Exception],
  ):
      size = example_file.stat().st_size
  
      api.upload_file_retry = Mock(side_effect=err)
      api.upload_file_retry_async = asyncify(Mock(side_effect=err))
      policy = WandbStoragePolicy(api=api, cache=artifact_file_cache)
  
      assert not is_cache_hit(artifact_file_cache, "my-digest", size)
  
      store = functools.partial(
          store_file, policy, entry_local_path=example_file
      )
  
      if err is None:
          store()
          assert is_cache_hit(artifact_file_cache, "my-digest", size)
      else:
          with pytest.raises(Exception, match=err.args[0]):
              store()
          assert not is_cache_hit(
              artifact_file_cache, "my-digest", size
          )
  
imports: import asyncio
  import functools
  import queue
  import shutil
  import unittest.mock
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Mapping, Optional
  from unittest.mock import Mock
  import pytest
  import requests
  from wandb.filesync.step_prepare import ResponsePrepare, StepPrepare
  from wandb.sdk.artifacts.artifact import Artifact
  from wandb.sdk.artifacts.artifact_file_cache import ArtifactFileCache
  from wandb.sdk.artifacts.artifact_instance_cache import artifact_instance_cache
  from wandb.sdk.artifacts.artifact_manifest_entry import ArtifactManifestEntry
  from wandb.sdk.artifacts.exceptions import ArtifactNotLoggedError
  from wandb.sdk.artifacts.storage_policies.wandb_storage_policy import WandbStoragePolicy
label_desc: Use image node_id 12 for calling the TestStoreFile obj's underlying member method code with example usage: obj.test_caches_result_on_success(store_file, api, example_file, artifact_file_cache, err) without return types