code: def test_mock_data_use_files(tmp_path):
      """Test `MockPolicy.USE_FILES` specific behavior."""
      with tfds.testing.mock_data(
          policy=tfds.testing.MockPolicy.USE_FILES
      ):
          builder = tfds.builder("mnist")
          # Metadata should have been restored correctly.
          assert builder.info.splits.keys() == {"test", "train"}
  
          # Unknown split should raise error
          # Currently, this error is accidentally triggered by
          # `info.splits[split].file_instructions` inside `_should_cache_ds`.
          # We could make the check more explicit.
          with pytest.raises(ValueError, match="Unknown split"):
              tfds.load("mnist", split="non_existent")
          with pytest.raises(ValueError, match="Unknown split"):
              tfds.data_source("mnist", split="non_existent")
  
      with tfds.testing.mock_data(
          policy=tfds.testing.MockPolicy.USE_FILES,
          data_dir=tmp_path,
      ):
          with pytest.raises(
              ValueError, match="copy the real metadata files"
          ):
              tfds.load("mnist")
          with pytest.raises(
              ValueError, match="copy the real metadata files"
          ):
              tfds.data_source("mnist", split="non_existent")
  
imports: import functools
  import pickle
  import numpy
  import pytest
  import tensorflow
  import tensorflow_datasets
label_desc: Use image node_id 13 for calling a global function with example usage: test_mock_data_use_files(tmp_path) without return types