forked from svanoort/pyresttest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension_use_test.yaml
29 lines (29 loc) · 1.11 KB
/
extension_use_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Simple tests to verify things work against a live REST service that returns JSON.. I picked github
---
- config:
- testset: "Simple github.com API Test with custom validator"
- generators:
- 'number' : {type: 'doubling', start: 8}
- test:
- name: "Test with successful validations"
- url: "/search/users?q=jewzaam"
- group: "Successful"
- validators:
- contains: 'subscriptions_url'
- extract_test: {jsonpath_mini: 'items.0', test: 'is_dict'}
- compare: {jsonpath_mini: 'items.0.login', comparator: 'str.eq.lower', expected: 'JewZaam'}
- extract_test: {'weirdzo': 'blah', test: 'exists'}
- test:
- generator_binds: {num: number}
- name: "Test with generator"
- url: {template: "/search/users?q=$num&in=id"}
- group: "Successful"
- validators:
- compare: {jsonpath_mini: 'items.0.login', comparator: 'contains', expected: '8'}
- test:
- generator_binds: {num: number}
- name: "Test with generator run 2"
- url: {template: "/search/users?q=$num&in=id"}
- group: "Successful"
- validators:
- compare: {jsonpath_mini: 'items.0.login', comparator: 'contains', expected: '16'}