test_name: Test basic controller relays functions

stages:
- name: "[controller_relays_basic] discover controllers"
  request:
    method: POST
    url: "http://localhost:5000/api/v1/controllers/discover/"
  response:
    status_code: 200
    verify_response_with:
      function: validate_controller:multiple
    save:
      json:
        returned_id: "[0].id"
        returned_relay_count: "[0].relay_count"

- name: "[controller_relays_basic] get controller relays, check length"
  request:
    method: GET
    url: "http://localhost:5000/api/v1/controllers/{returned_id}/relays"
  response:
    status_code: 200
    verify_response_with:
      function: validate_relay:multiple
      function: validate_relay:relay_count
      extra_kwargs:
        relay_count: !int "{returned_relay_count:d}"

- name: "[controller_relays_basic] get controller relays, check length"
  request:
    method: GET
    url: "http://localhost:5000/api/v1/controllers/{returned_id}/relays/5"
  response:
    status_code: 200
    verify_response_with:
      function: validate_relay:single
      function: validate_relay:check_controller_id
      extra_kwargs:
        name: "{returned_id}"
      function: validate_relay:check_number
      extra_kwargs:
        number: 5