core-legacy/tests/test_schedules_protected.tavern.yaml

79 lines
1.8 KiB
YAML
Raw Normal View History

test_name: Test protected schedules requests
2020-05-05 20:29:04 +00:00
stages:
- name: "[test_schedules_protected] delete protected off schedule; expect forbidden/fail"
request:
method: DELETE
url: "http://localhost:5000/api/v1/schedules/off"
response:
status_code: 403
2020-05-10 20:37:55 +00:00
- name: "[test_schedules_protected] get protected off schedule"
request:
method: GET
url: "http://localhost:5000/api/v1/schedules/off"
response:
status_code: 200
2020-05-10 20:37:55 +00:00
json:
id: "off"
name: "off"
periods: []
2020-05-10 20:37:55 +00:00
tags: !anylist
- name: "[test_schedules_protected] overwrite protected off schedule"
request:
method: PUT
url: "http://localhost:5000/api/v1/schedules/off"
json:
name: "turned_off"
periods:
- start: "00:10"
end: "00:20"
response:
status_code: 200
2020-05-10 20:37:55 +00:00
json:
id: "off"
name: "{tavern.request_vars.json.name}"
periods: []
2020-05-10 20:37:55 +00:00
tags: !anylist
- name: "[test_schedules_protected] delete protected on schedule; expect forbidden/fail"
request:
method: DELETE
url: "http://localhost:5000/api/v1/schedules/on"
response:
status_code: 403
2020-05-10 20:37:55 +00:00
- name: get protected on schedule
request:
method: GET
url: "http://localhost:5000/api/v1/schedules/on"
response:
status_code: 200
2020-05-10 20:37:55 +00:00
json:
id: "on"
name: "on"
periods:
- start: "00:00"
end: "23:59"
2020-05-10 20:37:55 +00:00
tags: !anylist
- name: "[test_schedules_protected] overwrite protected on schedule"
request:
method: PUT
url: "http://localhost:5000/api/v1/schedules/on"
json:
name: "turned_on"
periods:
- start: "16:10"
end: "17:20"
response:
status_code: 200
2020-05-10 20:37:55 +00:00
json:
id: "on"
name: "{tavern.request_vars.json.name}"
periods:
- start: "00:00"
end: "23:59"
2020-05-10 20:37:55 +00:00
tags: !anylist