code: def test_open_file_in_dir():
      with pytest.raises(ValueError):
          open_file_in_dir("/foo/bar/does/not/exist")
  
      # Create file and re-open
      for _ in range(2):
          file_fd, dir_fd = open_file_in_dir(filename)
  
          assert isinstance(file_fd, io.FileIO)
          file_fd.close()
  
          if platform.system() == "Windows":
              assert dir_fd is None
          else:
              assert isinstance(dir_fd, int)
              os.close(dir_fd)
  
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 5 for calling a global function with example usage: test_open_file_in_dir() without return types