class_docstr: Tests for the KnowledgeBase class.
class_docstr_tok: ["Tests","for","the","KnowledgeBase","class","."]
code: def test_num_experiments_property(
      self, storage: BaseStorageProtocol, n_previous_experiments: int
  ):
      create_experiments(
          storage=storage,
          n_previous_experiments=n_previous_experiments,
          n_trials_per_experiment=5,
      )
      kb = KnowledgeBase(storage)
      assert kb.n_stored_experiments == n_previous_experiments
  
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 4 for calling the TestKnowledgeBase obj's underlying member method code with example usage: obj.test_num_experiments_property(storage, n_previous_experiments) without return types