code: def test_confirm_name(monkeypatch, single_with_trials):
      """Test name must be confirmed for release"""
  
      def incorrect_name(*args):
          return "oops"
  
      monkeypatch.setattr("builtins.input", incorrect_name)
  
      with pytest.raises(SystemExit):
          execute("db release test_single_exp")
  
      def correct_name(*args):
          return "test_single_exp"
  
      monkeypatch.setattr("builtins.input", correct_name)
  
      experiments = setup_storage().fetch_experiments({})
      uid = experiments[0]["_id"]
      with setup_storage().acquire_algorithm_lock(
          uid=uid
      ) as algo_state_lock:
          assert algo_state_lock.state is None
          algo_state_lock.set_state({})
  
      with setup_storage().acquire_algorithm_lock(
          uid=uid
      ) as algo_state_lock:
          assert algo_state_lock.state == {}
          assert (
              setup_storage().get_algorithm_lock_info(uid=uid).locked
              == 1
          )
          execute("db release test_single_exp")
          assert (
              setup_storage().get_algorithm_lock_info(uid=uid).locked
              == 0
          )
          assert (
              setup_storage().get_algorithm_lock_info(uid=uid).state
              == {}
          )
  
file_path: orion/tests/functional/commands/test_db_release.py
imports: import pytest
  import orion.core.cli
  from orion.storage.base import setup_storage
label_desc: Use image node_id 3 for calling a global function with example usage: test_confirm_name(monkeypatch, single_with_trials) and returns: str, str