While writing the documentation it was discovered an additional test case was needed, so that is added here. It tests partial chunks of JSON.
75 lines
1.6 KiB
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
|