2020-05-07 00:38:58 +00:00
|
|
|
test_name: Test basic schedule requests
|
2020-05-05 20:29:04 +00:00
|
|
|
|
|
|
|
stages:
|
2020-05-07 00:38:58 +00:00
|
|
|
- name: "[test_schedules_basic] Make sure we get any response"
|
|
|
|
request:
|
|
|
|
url: "http://localhost:5000/api/v1/schedules/"
|
|
|
|
method: GET
|
|
|
|
response:
|
|
|
|
status_code: 200
|
|
|
|
- name: "[test_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
|
2020-05-10 20:37:55 +00:00
|
|
|
json:
|
2020-05-07 00:38:58 +00:00
|
|
|
name: "{tavern.request_vars.json.name}"
|
2020-05-10 20:37:55 +00:00
|
|
|
id: !anystr
|
|
|
|
periods: !anylist
|
|
|
|
tags: !anylist
|
2020-05-07 00:38:58 +00:00
|
|
|
save:
|
2020-05-10 20:37:55 +00:00
|
|
|
json:
|
|
|
|
returned_name: "name"
|
|
|
|
returned_id: "id"
|
2020-05-07 00:38:58 +00:00
|
|
|
- name: "[test_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
|
2020-05-10 20:37:55 +00:00
|
|
|
json:
|
2020-05-07 00:38:58 +00:00
|
|
|
name: "{returned_name}"
|
2020-05-10 20:37:55 +00:00
|
|
|
id: !anystr
|
|
|
|
periods: !anylist
|
|
|
|
tags: !anylist
|
|
|
|
|
2020-05-07 00:38:58 +00:00
|
|
|
- name: "[test_schedules_basic] delete schedule"
|
|
|
|
request:
|
|
|
|
method: DELETE
|
|
|
|
url: "http://localhost:5000/api/v1/schedules/{returned_id}"
|
|
|
|
response:
|
|
|
|
status_code: 200
|
2020-05-10 20:37:55 +00:00
|
|
|
|
2020-05-07 00:38:58 +00:00
|
|
|
- name: "[test_schedules_basic] get deleted schedule, expect 404"
|
|
|
|
request:
|
|
|
|
method: GET
|
|
|
|
url: "http://localhost:5000/api/v1/schedules/{returned_id}"
|
|
|
|
response:
|
|
|
|
status_code: 404
|