core-legacy/tests/tavern_tests/controllers_basic.tavern.yaml

106 lines
2.4 KiB
YAML
Raw Normal View History

2020-05-10 20:37:55 +00:00
test_name: Test basic controller functions
stages:
- name: "[controllers_basic] discover controllers"
2020-05-10 20:37:55 +00:00
request:
method: POST
url: "http://localhost:5000/api/v1/controllers/discover/"
response:
status_code: 200
json:
- id: !anystr
name: !anystr
relay_count: !anyint
relays: !anystr
active: !anybool
port: !anyint
ip: !anystr
relays: !anylist
save:
json:
returned_name: "[0].name"
returned_id: "[0].id"
- name: "[controllers_basic] get controller, check name"
2020-05-10 20:37:55 +00:00
request:
method: GET
url: "http://localhost:5000/api/v1/controllers/{returned_id}"
response:
status_code: 200
json:
name: "{returned_name}"
id: "{returned_id}"
relay_count: !anyint
relays: !anystr
active: !anybool
port: !anyint
ip: !anystr
relays: !anylist
- name: "[controllers_basic] get controller, check name"
2020-05-10 20:37:55 +00:00
request:
method: PUT
url: "http://localhost:5000/api/v1/controllers/{returned_id}"
json:
name: "renamed_controller"
response:
status_code: 200
json:
name: "{tavern.request_vars.json.name}"
id: "{returned_id}"
relay_count: !anyint
relays: !anystr
active: true
port: !anyint
ip: !anystr
relays: !anylist
save:
json:
changed_name: "name"
- name: "[controllers_basic] delete controller"
2020-05-10 20:37:55 +00:00
request:
method: DELETE
url: "http://localhost:5000/api/v1/controllers/{returned_id}"
response:
status_code: 200
- name: "[controllers_basic] get controller, expect 404"
2020-05-10 20:37:55 +00:00
request:
method: GET
url: "http://localhost:5000/api/v1/controllers/{returned_id}"
response:
status_code: 404
- name: "[controllers_basic] discover controllers again"
2020-05-10 20:37:55 +00:00
request:
method: POST
url: "http://localhost:5000/api/v1/controllers/discover/"
response:
status_code: 200
json:
- id: "{returned_id}"
name: "{changed_name}"
relay_count: !anyint
relays: !anystr
active: true
port: !anyint
ip: !anystr
relays: !anylist
- name: "[controllers_basic] get controller again, check name"
2020-05-10 20:37:55 +00:00
request:
method: GET
url: "http://localhost:5000/api/v1/controllers/{returned_id}"
response:
status_code: 200
json:
id: "{returned_id}"
name: "{changed_name}"
relay_count: !anyint
relays: !anystr
active: true
port: !anyint
ip: !anystr
relays: !anylist