def test_register_existing_trial(self): lineages = Lineages() trial = TrialStub(id="my-id") lineage = lineages.add(trial) assert lineages._lineage_roots == [lineage] assert lineage.item.objective is None trial.objective = ObjectiveStub(1) assert lineages.register(trial) is lineage assert lineages._lineage_roots == [lineage] assert lineage.item.objective.value == 1
def test_register_new_trial(self): lineages = Lineages() new_trial = TrialStub(id="new") lineage = lineages.register(new_trial) assert lineages._lineage_roots == [lineage]