code: def test_history_dump():
      new_history = history.History(save_agents=True)
  
      agents = [
          agent.Agent(
              n_variables=2,
              n_dimensions=1,
              lower_bound=[0, 0],
              upper_bound=[1, 1],
          )
          for _ in range(5)
      ]
  
      new_history.dump(agents=agents, best_agent=agents[4], value=0)
  
      assert len(new_history.agents) > 0
      assert len(new_history.best_agent) > 0
      assert new_history.value[0] == 0
  
      new_history = history.History(save_agents=False)
  
      new_history.dump(agents=agents)
  
      assert hasattr(new_history, "agents") is False
  
imports: from opytimizer.core import agent
  from opytimizer.utils import history
label_desc: Use image node_id 3 for calling a global function with example usage: test_history_dump() without return types