code: def test_fsmap():
      fs = LocalFileSystem.get_instance()
      with tempfile.TemporaryDirectory() as root:
          fs_map = FSMap(root, fs, check=True)
  
          path = "/to/path/test_file"
          test_content = b"text for test"
          fs_map[path] = test_content
          assert fs_map[path] == test_content
          assert len(fs_map) == 1
          assert path in fs_map
  
          path2 = "/to/path2/test_file2"
          fs_map[path2] = test_content
          assert len(fs_map) == 2
  
          del fs_map[path]
          assert list(fs_map) == ["to/path2/test_file2"]
  
          path3 = "/to2/path3/test_file3"
          fs_map[path3] = test_content
          assert fs_map.pop(path3) == test_content
          assert fs_map.pop(path3, "fake_content") == "fake_content"
          with pytest.raises(KeyError):
              fs_map.pop("not_exist")
  
          fs_map.clear()
          assert len(fs_map) == 0
  
          # test root not exist
          with pytest.raises(ValueError):
              _ = FSMap(root + "/path2", fs, check=True)
  
          # create root
          fs_map = FSMap(root + "/path2", fs, create=True)
          assert len(fs_map) == 0
  
file_path: mars/mars/lib/filesystem/tests/test_filesystem.py
imports: import glob
  import os
  import tempfile
  import numpy
  import pytest
  from ....tests.core import require_hadoop
  from ....utils import lazy_import
  from ..None import glob, FileSystem, LocalFileSystem, FSMap
label_desc: Use image node_id 5 for calling a global function with example usage: test_fsmap() without return types