class_docstr: Tests the server's response to benchmarks/:name
class_docstr_tok: ["Tests","the","server","'s","response","to","benchmarks\/",":","name"]
docstr: Tests that the benchmark returned is following the specification
docstr_tok: ["Tests","that","the","benchmark","returned","is","following","the","specification"]
code: def test_benchmark_specific_algorithms(self, client_with_benchmark):
      """Tests that the benchmark returned is following the specification"""
      response = client_with_benchmark.simulate_get(
          "/benchmarks/another_benchmark"
      )
  
      assert response.status == "200 OK"
      assert response.json["name"] == "another_benchmark"
      assert response.json["algorithms"] == [
          "gridsearch",
          {"random": {"seed": 1}},
      ]
      assert response.json["tasks"] == [
          {"Branin": {"max_trials": 10}},
          {"CarromTable": {"max_trials": 20}},
          {"EggHolder": {"dim": 4, "max_trials": 20}},
      ]
      assert response.json["assessments"] == [
          {"AverageResult": {"repetitions": 2}},
          {"AverageRank": {"repetitions": 2}},
      ]
      _assert_plot_contains(
          "gridsearch",
          response.json["analysis"]["AverageResult"]["Branin"][
              "regrets"
          ],
      )
      _assert_plot_contains(
          "random",
          response.json["analysis"]["AverageResult"]["Branin"][
              "regrets"
          ],
      )
  
      response = client_with_benchmark.simulate_get(
          "/benchmarks/another_benchmark?algorithms=random"
      )
  
      assert response.status == "200 OK"
      assert response.json["name"] == "another_benchmark"
      assert response.json["algorithms"] == [
          "gridsearch",
          {"random": {"seed": 1}},
      ]
      with pytest.raises(AssertionError):
          _assert_plot_contains(
              "gridsearch",
              response.json["analysis"]["AverageResult"]["Branin"][
                  "regrets"
              ],
          )
      _assert_plot_contains(
          "random",
          response.json["analysis"]["AverageResult"]["Branin"][
              "regrets"
          ],
      )
  
      response = client_with_benchmark.simulate_get(
          "/benchmarks/another_benchmark?algorithms=random&algorithms=gridsearch"
      )
  
      assert response.status == "200 OK"
      assert response.json["name"] == "another_benchmark"
      assert response.json["algorithms"] == [
          "gridsearch",
          {"random": {"seed": 1}},
      ]
      _assert_plot_contains(
          "gridsearch",
          response.json["analysis"]["AverageResult"]["Branin"][
              "regrets"
          ],
      )
      _assert_plot_contains(
          "random",
          response.json["analysis"]["AverageResult"]["Branin"][
              "regrets"
          ],
      )
  
imports: import json
  import os
  import pytest
  from falcon import testing
  from orion.benchmark.assessment import AverageRank, AverageResult
  from orion.benchmark.benchmark_client import get_or_create_benchmark
  from orion.benchmark.task import Branin, CarromTable, EggHolder
  from orion.serving.webapi import WebApi
  from orion.storage.base import setup_storage
label_desc: Use image node_id 5 for calling the TestItem obj's underlying member method code with example usage: obj.test_benchmark_specific_algorithms(client_with_benchmark) without return types