2020-02-23 19:06:14 +00:00
|
|
|
test_name: Test basic requests
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- name: Make sure we get any response
|
|
|
|
request:
|
|
|
|
url: "http://localhost:5000/api/v1/schedules/"
|
|
|
|
method: GET
|
|
|
|
response:
|
|
|
|
status_code: 200
|
|
|
|
- name: 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: 200
|
|
|
|
body:
|
|
|
|
name: "{tavern.request_vars.json.name}"
|
|
|
|
save:
|
|
|
|
body:
|
|
|
|
returned_name: name
|
|
|
|
returned_id: id
|
|
|
|
- name: get schedule, check name and some periods
|
|
|
|
request:
|
|
|
|
method: GET
|
|
|
|
url: "http://localhost:5000/api/v1/schedules/{returned_id}"
|
|
|
|
response:
|
|
|
|
status_code: 200
|
|
|
|
body:
|
|
|
|
name: "{returned_name}"
|
2020-02-23 21:54:33 +00:00
|
|
|
- name: delete schedule
|
|
|
|
request:
|
|
|
|
method: DELETE
|
|
|
|
url: "http://localhost:5000/api/v1/schedules/{returned_id}"
|
|
|
|
response:
|
|
|
|
status_code: 200
|
|
|
|
- name: get deleted schedule, expect 404
|
|
|
|
request:
|
|
|
|
method: GET
|
|
|
|
url: "http://localhost:5000/api/v1/schedules/{returned_id}"
|
|
|
|
response:
|
|
|
|
status_code: 404
|