code: def test_file_history(tmpdir):
      histfile = tmpdir.join("history")
  
      history = FileHistory(histfile)
  
      history.append_string("hello")
      history.append_string("world")
  
      # Newest should yield first.
      assert _call_history_load(history) == ["world", "hello"]
  
      # Test another call.
      assert _call_history_load(history) == ["world", "hello"]
  
      history.append_string("test3")
      assert _call_history_load(history) == ["test3", "world", "hello"]
  
      # Create another history instance pointing to the same file.
      history2 = FileHistory(histfile)
      assert _call_history_load(history2) == ["test3", "world", "hello"]
  
imports: from __future__ import annotations
  from asyncio import run
  from prompt_toolkit.history import FileHistory, InMemoryHistory, ThreadedHistory
label_desc: Use image node_id 3 for calling a global function with example usage: test_file_history(tmpdir) without return types