class_docstr: Tests for the KnowledgeBase class.
class_docstr_tok: ["Tests","for","the","KnowledgeBase","class","."]
code: def test_empty_kb(self, storage: BaseStorageProtocol):
      knowledge_base = KnowledgeBase(storage)
      assert knowledge_base.n_stored_experiments == 0
      target_experiment = build_experiment(
          name="foo",
          space={"x": "uniform(0, 1)"},
          debug=True,
      )
      assert not knowledge_base.get_related_trials(target_experiment)
  
file_path: orion/tests/unittests/core/worker/warm_start/test_knowledge_base.py
imports: from __future__ import annotations
  from pathlib import Path
  import pytest
  from orion.benchmark.task import RosenBrock
  from orion.client import build_experiment
  from orion.client.experiment import ExperimentClient
  from orion.core.io.database.pickleddb import PickledDB
  from orion.core.worker.experiment_config import ExperimentConfig
  from orion.core.worker.warm_start import KnowledgeBase
  from orion.storage.base import BaseStorageProtocol
  from orion.storage.legacy import Legacy
label_desc: Use image node_id 1 for calling the TestKnowledgeBase obj's underlying member method code with example usage: obj.test_empty_kb(storage) without return types