88 lines
2.4 KiB
YAML
88 lines
2.4 KiB
YAML
|
test_name: Test basic schedule requests
|
||
|
|
||
|
stages:
|
||
|
- name: "[schedules_basic] Make sure we get any response"
|
||
|
request:
|
||
|
url: "http://localhost:5000/api/v1/schedules/"
|
||
|
method: GET
|
||
|
response:
|
||
|
status_code: 200
|
||
|
verify_response_with:
|
||
|
function: validate_schedule:multiple
|
||
|
|
||
|
- name: "[schedules_basic] post schedule with no periods, expect it to be echoed back"
|
||
|
request:
|
||
|
method: POST
|
||
|
url: "http://localhost:5000/api/v1/schedules/"
|
||
|
json:
|
||
|
name: "same as off"
|
||
|
periods: []
|
||
|
response:
|
||
|
status_code: 201
|
||
|
verify_response_with:
|
||
|
function: validate_schedule:single
|
||
|
function: validate_schedule:check_name
|
||
|
extra_kwargs:
|
||
|
name: "{tavern.request_vars.json.name}"
|
||
|
function: validate_schedule:check_periods
|
||
|
extra_kwargs:
|
||
|
periods: "{tavern.request_vars.json.periods}"
|
||
|
|
||
|
- name: "[schedules_basic] post schedule, expect it to be echoed back"
|
||
|
request:
|
||
|
method: POST
|
||
|
url: "http://localhost:5000/api/v1/schedules/"
|
||
|
json:
|
||
|
name: "hello"
|
||
|
periods:
|
||
|
- start: "00:10"
|
||
|
end: "00:20"
|
||
|
- start: "00:30"
|
||
|
end: "00:40"
|
||
|
- start: "00:50"
|
||
|
end: "01:00"
|
||
|
response:
|
||
|
status_code: 201
|
||
|
verify_response_with:
|
||
|
function: validate_schedule:single
|
||
|
function: validate_schedule:check_name
|
||
|
extra_kwargs:
|
||
|
name: "{tavern.request_vars.json.name}"
|
||
|
function: validate_schedule:check_periods
|
||
|
extra_kwargs:
|
||
|
periods: "{tavern.request_vars.json.periods}"
|
||
|
save:
|
||
|
json:
|
||
|
returned_name: "name"
|
||
|
returned_id: "id"
|
||
|
returned_periods: "periods"
|
||
|
|
||
|
- name: "[schedules_basic] get schedule, check name and some periods"
|
||
|
request:
|
||
|
method: GET
|
||
|
url: "http://localhost:5000/api/v1/schedules/{returned_id}"
|
||
|
response:
|
||
|
status_code: 200
|
||
|
verify_response_with:
|
||
|
function: validate_schedule:single
|
||
|
function: validate_schedule:check_name
|
||
|
extra_kwargs:
|
||
|
name: "{returned_name}"
|
||
|
function: validate_schedule:check_periods
|
||
|
extra_kwargs:
|
||
|
periods: "{returned_periods}"
|
||
|
|
||
|
- name: "[schedules_basic] delete schedule"
|
||
|
request:
|
||
|
method: DELETE
|
||
|
url: "http://localhost:5000/api/v1/schedules/{returned_id}"
|
||
|
response:
|
||
|
status_code: 200
|
||
|
|
||
|
- name: "[schedules_basic] get deleted schedule, expect 404"
|
||
|
request:
|
||
|
method: GET
|
||
|
url: "http://localhost:5000/api/v1/schedules/{returned_id}"
|
||
|
response:
|
||
|
status_code: 404
|