code: def test_load_overwrite(
      other_empty_database,
      pkl_experiments_and_benchmarks,
      capsys,
      testing_helpers,
  ):
      """Test load all database with --resolve overwrite"""
      storage, cfg_path = other_empty_database
      loaded_db = storage._db
      testing_helpers.check_empty_db(loaded_db)
  
      execute(f"db load {pkl_experiments_and_benchmarks} -c {cfg_path}")
      testing_helpers.assert_tested_db_structure(loaded_db)
      testing_helpers.assert_tested_trial_status(loaded_db)
  
      # Change something in PKL file to check that changes are ignored
      src_db = PickledDB(pkl_experiments_and_benchmarks)
      testing_helpers.assert_tested_trial_status(src_db)
      for trial in src_db.read("trials"):
          trial["status"] = "new"
          src_db.write("trials", trial, query={"_id": trial["_id"]})
      testing_helpers.assert_tested_db_structure(src_db)
      # Trials status checking should fail for PKL file
      with pytest.raises(AssertionError):
          testing_helpers.assert_tested_trial_status(src_db)
      # ... And pass for a specific count
      testing_helpers.assert_tested_trial_status(
          src_db, counts={"new": 24}
      )
  
      execute(
          f"db load {pkl_experiments_and_benchmarks} -r overwrite -c {cfg_path}"
      )
      # We expect same data structure after overwriting
      testing_helpers.assert_tested_db_structure(loaded_db)
      # Trial status checking must fail by default
      with pytest.raises(AssertionError):
          testing_helpers.assert_tested_trial_status(loaded_db)
      # ... And pass for specific changes
      testing_helpers.assert_tested_trial_status(
          loaded_db, counts={"new": 24}
      )
  
      # Check output to verify progress callback messages
      captured = capsys.readouterr()
      assert captured.err.strip() == ""
      assert (
          captured.out.strip()
          == """
  STEP 1 Collect source experiments to load 0 1
  STEP 1 Collect source experiments to load 1 1
  STEP 2 Check benchmarks 0 3
  STEP 2 Check benchmarks 1 3
  STEP 2 Check benchmarks 2 3
  STEP 2 Check benchmarks 3 3
  STEP 3 Check destination experiments 0 1
  STEP 3 Check destination experiments 1 1
  STEP 4 Check source experiments 0 3
  STEP 4 Check source experiments 1 3
  STEP 4 Check source experiments 2 3
  STEP 4 Check source experiments 3 3
  STEP 5 Delete data to replace in destination 0 0
  STEP 6 Insert new data in destination 0 6
  STEP 6 Insert new data in destination 1 6
  STEP 6 Insert new data in destination 2 6
  STEP 6 Insert new data in destination 3 6
  STEP 6 Insert new data in destination 4 6
  STEP 6 Insert new data in destination 5 6
  STEP 6 Insert new data in destination 6 6
  STEP 1 Collect source experiments to load 0 1
  STEP 1 Collect source experiments to load 1 1
  STEP 2 Check benchmarks 0 3
  STEP 2 Check benchmarks 1 3
  STEP 2 Check benchmarks 2 3
  STEP 2 Check benchmarks 3 3
  STEP 3 Check destination experiments 0 1
  STEP 3 Check destination experiments 1 1
  STEP 4 Check source experiments 0 3
  STEP 4 Check source experiments 1 3
  STEP 4 Check source experiments 2 3
  STEP 4 Check source experiments 3 3
  STEP 5 Delete data to replace in destination 0 12
  STEP 5 Delete data to replace in destination 1 12
  STEP 5 Delete data to replace in destination 2 12
  STEP 5 Delete data to replace in destination 3 12
  STEP 5 Delete data to replace in destination 4 12
  STEP 5 Delete data to replace in destination 5 12
  STEP 5 Delete data to replace in destination 6 12
  STEP 5 Delete data to replace in destination 7 12
  STEP 5 Delete data to replace in destination 8 12
  STEP 5 Delete data to replace in destination 9 12
  STEP 5 Delete data to replace in destination 10 12
  STEP 5 Delete data to replace in destination 11 12
  STEP 5 Delete data to replace in destination 12 12
  STEP 6 Insert new data in destination 0 6
  STEP 6 Insert new data in destination 1 6
  STEP 6 Insert new data in destination 2 6
  STEP 6 Insert new data in destination 3 6
  STEP 6 Insert new data in destination 4 6
  STEP 6 Insert new data in destination 5 6
  STEP 6 Insert new data in destination 6 6
  """.strip()
      )
  
file_path: orion/tests/functional/commands/test_db_load.py
imports: import os
  import pytest
  import orion.core.cli
  from orion.core.io.database.pickleddb import PickledDB
  from orion.storage.base import setup_storage
label_desc: Use image node_id 6 for calling a global function with example usage: test_load_overwrite(other_empty_database, pkl_experiments_and_benchmarks, capsys, testing_helpers) without return types