class_docstr: Test Trial object and class.
docstr: Check property `Trial.objective`.
docstr_tok: ["Check","property","`","Trial.objective","`","."]
code: def test_objective_property(self):
      """Check property `Trial.objective`."""
      base_trial = {"results": []}
      base_trial["results"].append(
          {"name": "a", "type": "gradient", "value": 0.5}
      )
  
      # 0 objective in `results` list
      trial = Trial(**base_trial)
  
      assert trial.objective is None
  
      # 1 results in `results` list
      expected = Trial.Result(name="b", type="objective", value=42)
  
      base_trial["results"].append(
          {"name": "b", "type": "objective", "value": 42}
      )
      trial = Trial(**base_trial)
  
      assert trial.objective == expected
  
      # >1 results in `results` list
      base_trial["results"].append(
          {"name": "c", "type": "objective", "value": 42}
      )
      trial = Trial(**base_trial)
  
      assert trial.objective == expected
  
imports: import copy
  import datetime
  import os
  import warnings
  import bson
  import numpy
  import pytest
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 17 for calling the TestTrial obj's underlying member method code with example usage: obj.test_objective_property() without return types