code: def test_file_memory_freelist():
      mem = FileMemory(filename, tree_conf)
      assert mem.next_available_page == 1
      assert mem._traverse_free_list() == (None, None)
  
      mem.del_page(1)
      assert mem._traverse_free_list() == (
          None,
          FreelistNode(tree_conf, page=1, next_page=None),
      )
      assert mem.next_available_page == 1
      assert mem._traverse_free_list() == (None, None)
  
      mem.del_page(1)
      mem.del_page(2)
      assert mem._traverse_free_list() == (
          FreelistNode(tree_conf, page=1, next_page=2),
          FreelistNode(tree_conf, page=2, next_page=None),
      )
      mem.del_page(3)
      assert mem._traverse_free_list() == (
          FreelistNode(tree_conf, page=2, next_page=3),
          FreelistNode(tree_conf, page=3, next_page=None),
      )
  
      assert mem._pop_from_freelist() == 3
      assert mem._pop_from_freelist() == 2
      assert mem._pop_from_freelist() == 1
      assert mem._pop_from_freelist() is None
  
imports: import io
  import os
  import platform
  from unittest import mock
  import pytest
  from bplustree.node import LeafNode, FreelistNode
  from bplustree.memory import FileMemory, open_file_in_dir, WAL, ReachedEndOfFile, write_to_file
  from bplustree.const import TreeConf
  from .conftest import filename
  from bplustree.serializer import IntSerializer
label_desc: Use image node_id 4 for calling a global function with example usage: test_file_memory_freelist() without return types