code: def test_demo_with_default_algo_cli_config_only(storage, monkeypatch):
      """Check that random algorithm is used, when no algo is chosen explicitly."""
      monkeypatch.chdir(os.path.dirname(os.path.abspath(__file__)))
  
      orion.core.cli.main(
          [
              "hunt",
              "-n",
              "default_algo",
              "--max-trials",
              "5",
              "./black_box.py",
              "-x~uniform(-50, 50)",
          ]
      )
  
      exp = list(storage.fetch_experiments({"name": "default_algo"}))
      assert len(exp) == 1
      exp = exp[0]
      assert "_id" in exp
      assert exp["name"] == "default_algo"
      assert exp["max_trials"] == 5
      assert exp["max_broken"] == 3
      assert exp["algorithm"] == {"random": {"seed": None}}
      assert "user" in exp["metadata"]
      assert "datetime" in exp["metadata"]
      assert "orion_version" in exp["metadata"]
      assert "user_script" in exp["metadata"]
      assert exp["metadata"]["user_args"] == [
          "./black_box.py",
          "-x~uniform(-50, 50)",
      ]
  
      trials = list(storage.fetch_trials(uid=exp["_id"]))
      assert len(trials) <= 10
      assert trials[-1].status == "completed"
  
imports: import os
  import shutil
  import subprocess
  import sys
  import tempfile
  from collections import defaultdict
  from contextlib import contextmanager
  import numpy
  import pytest
  import yaml
  import orion.core.cli
  import orion.core.io.experiment_builder
  from orion.core.cli.hunt import workon
  from orion.testing import OrionState
label_desc: Use image node_id 1 for calling a global function with example usage: test_demo_with_default_algo_cli_config_only(storage, monkeypatch) without return types