-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjsonpath.yaml
More file actions
56 lines (53 loc) · 1.06 KB
/
jsonpath.yaml
File metadata and controls
56 lines (53 loc) · 1.06 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: "Using JSONPath in expectations"
topic: "core/Repeat"
fixture:
type: 'fbp'
data: |
# @runtime python-example
INPORT=it.IN:IN
OUTPORT=f.OUT:OUT
it(core/Repeat) OUT -> IN f(core/Repeat)
cases:
-
name: 'select single value'
assertion: 'should pass'
inputs:
in: { outer: { inner: { foo: 'bar' } } }
expect:
out:
path: '$.outer.inner.foo'
equals: 'bar'
-
name: 'selecting non-existent value'
assertion: 'should fail'
inputs:
in: { outer: { inner: { foo: 'bar' } } }
expect:
out:
path: '$.outer.nonexist'
equals: 'bar'
-
name: 'selecting many correct values'
assertion: 'should pass'
inputs:
in:
outer:
first: { foo: 'bar' }
second: { foo: 'bar' }
expect:
out:
path: '$.outer.*.foo'
equals: 'bar'
-
name: 'selecting many values, some failing'
assertion: 'should fail'
inputs:
in:
outer:
first: { foo: 'bar' }
second: { foo: 'bar' }
third: { foo: 'bazz' }
expect:
out:
path: '$.outer.*.foo'
equals: 'bar'