code: def test_serialization_fs(mockfs):
      import faiss
  
      index = FaissIndex(metric_type=faiss.METRIC_INNER_PRODUCT)
      index.add_vectors(np.eye(5, dtype=np.float32))
  
      index_name = "index.faiss"
      path = f"mock://{index_name}"
      index.save(path, storage_options=mockfs.storage_options)
      index = FaissIndex.load(
          path, storage_options=mockfs.storage_options
      )
  
      query = np.zeros(5, dtype=np.float32)
      query[1] = 1
      scores, indices = index.search(query)
      assert scores[0] > 0
      assert indices[0] == 1
  
imports: import os
  import tempfile
  from functools import partial
  from unittest import TestCase
  from unittest.mock import patch
  import numpy
  import pytest
  from datasets.arrow_dataset import Dataset
  from datasets.search import ElasticSearchIndex, FaissIndex, MissingIndex
  from .utils import require_elasticsearch, require_faiss
label_desc: Use image node_id 1 for calling a global function with example usage: test_serialization_fs(mockfs) without return types