core-legacy/tests/tavern_tests/1.1.controller_relays_basic.tavern.yaml

109 lines
3.1 KiB
YAML
Raw Normal View History

test_name: Test basic controller relays functions
stages:
2020-05-31 22:45:08 +00:00
- name: "[controller_relays_basic] get controllers"
request:
2020-05-31 22:45:08 +00:00
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}"
2020-08-29 07:10:50 +00:00
- name: "[controller_relays_basic] get controller relay"
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
2020-08-29 07:10:50 +00:00
- name: "[controller_relays_basic] get controller relay with invalid uid"
request:
method: GET
url: "http://localhost:5000/api/v1/controllers/INVALID-UUID/relays/5"
response:
status_code: 400
- name: "[controller_relays_basic] get controller relay with unavailable uid"
request:
method: GET
url: "http://localhost:5000/api/v1/controllers/00000000-0000-0000-0000-000000000000/relays/5"
response:
status_code: 404
- name: "[controller_relays_basic] get controller relay with invalid number"
request:
method: GET
url: "http://localhost:5000/api/v1/controllers/{returned_id}/relays/not_a_number"
response:
status_code: 404
- name: "[controller_relays_basic] get controller relay with unavailable number"
request:
method: GET
url: "http://localhost:5000/api/v1/controllers/{returned_id}/relays/9001"
response:
status_code: 404
- name: "[controller_relays_basic] pulse relay"
request:
method: POST
url: "http://localhost:5000/api/v1/controllers/{returned_id}/relays/6/pulse"
response:
status_code: 200
- name: "[controller_relays_basic] pulse relay with invalid uid"
request:
method: POST
url: "http://localhost:5000/api/v1/controllers/INVALID-UUID/relays/6/pulse"
response:
status_code: 400
- name: "[controller_relays_basic] pulse relay with unavailable uid"
request:
method: POST
url: "http://localhost:5000/api/v1/controllers/00000000-0000-0000-0000-000000000000/relays/6/pulse"
response:
status_code: 404
- name: "[controller_relays_basic] pulse relay with invalid number"
request:
method: POST
url: "http://localhost:5000/api/v1/controllers/{returned_id}/relays/not_a_number/pulse"
response:
status_code: 404
- name: "[controller_relays_basic] pulse relay with unavailable number"
request:
method: POST
url: "http://localhost:5000/api/v1/controllers/{returned_id}/relays/9001/pulse"
response:
status_code: 404