class_docstr: Tests trials/:experiment_name
docstr: Tests that trials are returned
docstr_tok: ["Tests","that","trials","are","returned"]
code: def test_trials_by_status(self, client, ephemeral_storage):
      """Tests that trials are returned"""
      storage = ephemeral_storage.storage
  
      add_experiment(storage, name="a", version=1, _id=1)
  
      # There exist no trial of the given status in an empty experiment
      response = client.simulate_get("/trials/a?status=completed")
  
      assert response.status == "200 OK"
      assert response.json == []
  
      # There exist no trial of the given status while other status are present
      add_trial(
          storage,
          experiment=1,
          id_override="00",
          status="broken",
          value=0,
      )
  
      response = client.simulate_get("/trials/a?status=completed")
      assert response.status == "200 OK"
      assert response.json == []
  
      # There exist at least one trial of the given status
      add_trial(
          storage,
          experiment=1,
          id_override="01",
          status="completed",
          value=1,
      )
  
      response = client.simulate_get("/trials/a?status=completed")
  
      assert response.status == "200 OK"
      assert response.json == [
          {"id": "79a873a1146cbdcc385f53e7c14f41aa"}
      ]
  
      # Status doesn't exist
      response = client.simulate_get("/trials/a?status=invalid")
  
      assert response.status == "400 Bad Request"
      error_message = (
          "Invalid status value. "
          "Expected one of "
          "['new', 'reserved', 'suspended', 'completed', 'interrupted', 'broken']"
      )
      assert response.json == {
          "title": "Invalid parameter",
          "description": 'The "status" parameter is invalid. '
          "The value of the parameter must be one of "
          "['new', 'reserved', 'suspended', 'completed', "
          "'interrupted', 'broken']",
      }
  
imports: import copy
  import datetime
  import random
  import falcon
  from orion.core.io import experiment_builder
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 6 for calling the TestTrialCollection obj's underlying member method code with example usage: obj.test_trials_by_status(client, ephemeral_storage) without return types