class_docstr: Test Trial object and class.
docstr: Tests the property for accessing constraints
docstr_tok: ["Tests","the","property","for","accessing","constraints"]
code: def test_constraints_property(self):
      """Tests the property for accessing constraints"""
      base_trial = {"results": []}
  
      # 0 result exist
      trial = Trial(**base_trial)
      assert trial.constraints == []
  
      # 0 result of type 'constraints' exist
      base_trial["results"].append(
          {"name": "a", "type": "objective", "value": 10}
      )
      trial = Trial(**base_trial)
  
      assert trial.constraints == []
  
      # 1 result of type 'constraint' exist
      expected = [Trial.Result(name="b", type="constraint", value=5)]
  
      base_trial["results"].append(
          {"name": "b", "type": "constraint", "value": 5}
      )
      trial = Trial(**base_trial)
  
      assert expected == trial.constraints
  
      # > 1 results of type 'constraint' exist
      expected = [
          Trial.Result(name="b", type="constraint", value=5),
          Trial.Result(name="c", type="constraint", value=20),
      ]
  
      base_trial["results"].append(
          {"name": "c", "type": "constraint", "value": 20}
      )
      trial = Trial(**base_trial)
  
      assert expected == trial.constraints
  
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 19 for calling the TestTrial obj's underlying member method code with example usage: obj.test_constraints_property() without return types