class_docstr: Tests for the `RegistryMapping` class. The RegistryMapping should act as a
  Mapping[Trial, list[Trial]].
class_docstr_tok: ["Tests","for","the","`","RegistryMapping","`","class",".","The","RegistryMapping","should","act","as","a","Mapping","[","Trial",",","list","[","Trial","]","]","."]
docstr: Tests for the `register` method of the `RegistryMapping` class.
docstr_tok: ["Tests","for","the","`","register","`","method","of","the","`","RegistryMapping","`","class","."]
code: def test_register(
      self, space: Space, transformed_space: TransformedSpace
  ):
      """Tests for the `register` method of the `RegistryMapping` class."""
      original_reg = Registry()
      transformed_reg = Registry()
      mapping = RegistryMapping(
          original_registry=original_reg,
          transformed_registry=transformed_reg,
      )
  
      original_trial = space.sample(1)[0]
      transformed_trial = transformed_space.transform(original_trial)
  
      mapping.register(original_trial, transformed_trial)
      # NOTE: register doesn't actually register the trial, it just adds it to the mapping.
      assert len(mapping) == 1
      assert original_trial in mapping
  
      # NOTE: Here since we assume that the trials are supposed to be registered in the registries
      # externally, we can't yet iterate over the mapping (e.g. with keys(), values() or items()).
  
      # Now we actually register the trials in the individual registries.
      assert original_trial not in original_reg
      original_stored_id = original_reg.register(original_trial)
      assert transformed_trial not in transformed_reg
      transformed_stored_id = transformed_reg.register(
          transformed_trial
      )
  
      assert mapping._mapping == {
          original_stored_id: {transformed_stored_id}
      }
      assert list(mapping.keys()) == [original_trial]
      assert list(mapping.values()) == [[transformed_trial]]
      assert mapping[original_trial] == [transformed_trial]
  
imports: import copy
  import pytest
  from orion.algo.base.registry import Registry, RegistryMapping
  from orion.algo.space import Space
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.worker.transformer import TransformedSpace, build_required_space
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 3 for calling the TestRegistryMapping obj's underlying member method code with example usage: obj.test_register(space, transformed_space) without return types