code: def test_caching_empty_resource(
      default_model_storage: ModelStorage,
      tmp_path: Path,
      tmp_path_factory: TempPathFactory,
  ):
      resource_name = "my resource"
      resource = Resource(resource_name)
  
      # does not raise
      resource.to_cache(tmp_path, default_model_storage)
  
      with pytest.raises(ValueError):
          with default_model_storage.read_from(resource) as _:
              pass
  
      cache_dir = tmp_path_factory.mktemp("cache_dir")
  
      # this doesn't create an empty directory in `default_model_storage`
      Resource.from_cache(
          resource_name,
          cache_dir,
          default_model_storage,
          resource.output_fingerprint,
      )
  
      with pytest.raises(ValueError):
          with default_model_storage.read_from(resource) as _:
              pass
  
file_path: rasa/tests/engine/storage/test_resource.py
imports: from pathlib import Path
  import pytest
  from _pytest.tmpdir import TempPathFactory
  import rasa.utils.common
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
label_desc: Use image node_id 5 for calling a global function with example usage: test_caching_empty_resource(default_model_storage, tmp_path, tmp_path_factory) without return types