Skip to content

Instantly share code, notes, and snippets.

@cdent
Last active March 11, 2017 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdent/ec00b89b36fb7cf937a935fe041e200d to your computer and use it in GitHub Desktop.
Save cdent/ec00b89b36fb7cf937a935fe041e200d to your computer and use it in GitHub Desktop.
defaults:
request_headers:
content-type: application/json
verbose: True
tests:
- name: post data
POST: /
data:
one_string: "1"
one_int: 1
one_float: 1.1
response_json_paths:
$.one_string: "1"
$.one_int: 1
$.one_float: 1.1
response_strings:
- '"one_string": "1"'
- '"one_int": 1'
- '"one_float": 1.1'
- name: use data
desc: data will be coerced because templates in use
POST: /
data:
one_string: $RESPONSE['$.one_string']
one_int: $RESPONSE['$.one_int']
one_float: $RESPONSE['$.one_float']
response_json_paths:
$.one_string: 1
$.one_int: 1
$.one_float: 1.1
response_strings:
- '"one_string": 1'
- '"one_int": 1'
- '"one_float": 1.1'
- name: from environ
POST: /
data:
one_environ: $ENVIRON['ONE']
response_json_paths:
$.one_environ: 1
response_strings:
- '"one_environ": 1'
- name: with list
desc: no support for lists yet
xfail: true
POST: /
data:
- $ENVIRON['ONE']
- 2
- "3"
response_json_paths:
$[0]: 1
$[1]: 2
$[2]: 3
response_strings:
- '[1, 2, 3]'
- name: object with list
desc: without recursive handling no coersion
xfail: true
POST: /
data:
collection:
- alpha: $ENVIRON['ONE']
beta: max
- alpha: 2
beta: climb
response_json_paths:
$.collection[0].alpha: 1
$.collection[0].beta: max
$.collection[1].alpha: 2
$.collection[2].beta: climb
response_strings:
- "alpha": 1
- "beta": "max"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment