class_docstr: Tests for the `Registry` class. The `Registry` should basically act as a `Container[Trial]`,
  and so the tests should be roughly the same as if they were testing the built-in `dict` class.
class_docstr_tok: ["Tests","for","the","`","Registry","`","class",".","The","`","Registry","`","should","basically","act","as","a","`","Container","[","Trial","]","`",",","and","so","the","tests","should","be","roughly","the","same","as","if","they","were","testing","the","built-in","`","dict","`","class","."]
docstr: Tests that registering a trial with the same params overwrites the existing trial.
docstr_tok: ["Tests","that","registering","a","trial","with","the","same","params","overwrites","the","existing","trial","."]
code: def test_register_overwrite_with_status(
      self, space: Space, status: str
  ):
      """Tests that registering a trial with the same params overwrites the existing trial."""
      registry = Registry()
      trial = space.sample(1)[0]
      registered_id = registry.register(trial)
      assert len(registry) == 1
      assert list(registry) == [trial]
  
      assert registry[registered_id] == trial
  
      same_but_with_status = copy.deepcopy(trial)
      same_but_with_status._status = status
  
      same_id = registry.register(same_but_with_status)
      assert same_id == registered_id
      assert len(registry) == 1
      assert list(registry) == [same_but_with_status]
  
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 4 for calling the TestRegistry obj's underlying member method code with example usage: obj.test_register_overwrite_with_status(space, status) without return types