common/tests/tavern_tests/1.1.controller_relays_basic.tavern.yaml
Tobias Reisinger 2af71a8d84 Readd tests
Just copied from old version. Most will fail and run_tests.sh is not
working.
2022-04-03 01:36:18 +02:00

42 lines
1.2 KiB
YAML

test_name: Test basic controller relays functions
stages:
- name: "[controller_relays_basic] get controllers"
request:
method: GET
url: "http://localhost:5000/api/v1/controllers/"
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