deb-python-gabbi/gabbi/tests/gabbits_intercept/data.yaml

75 lines
1.6 KiB
YAML

# Test loading POST data via data structures and file
#
tests:
- name: load data dictionary
url: /
method: POST
request_headers:
content-type: application/json
data:
foo: 1
bar: 2
response_json_paths:
foo: 1
bar: 2
- name: load data list
url: /
method: POST
request_headers:
content-type: application/json
data:
- 1
- 2
response_json_paths:
$[0]: 1
$[1]: 2
$.`len`: 2
- name: load json file
url: /
method: POST
request_headers:
content-type: application/json
data: <@data.json
response_json_paths:
foo['bár']: 1
- name: load image file
url: /
method: POST
request_headers:
content-type: image/png
data: <@kitten.png
- name: load encoded text
url: /
method: POST
request_headers:
content-type: text/plain
data: <@utf8.txt
- name: json value from disk
POST: /
request_headers:
content-type: application/json
data: <@data.json
response_json_paths:
foo['bár']: 1
$: <@data.json
- name: partial json from disk
POST: /
request_headers:
content-type: application/json
data:
pets:
- type: cat
sound: meow
- type: dog
sound: woof
response_json_paths:
$.pets: <@pets.json
$.pets[0]: <@cat.json