File: queryparams.yaml

package info (click to toggle)
python-gabbi 3.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 932 kB
  • sloc: python: 3,711; makefile: 60; sh: 32
file content (57 lines) | stat: -rw-r--r-- 1,466 bytes parent folder | download | duplicates (6)
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
57
#
# As a convenience a URL can be augmented with structured declaration
# of query parameters.
#

tests:

    - name: simple param
      url: /foo
      query_parameters:
          bar: 1
      response_headers:
          x-gabbi-url: $SCHEME://$NETLOC/foo?bar=1

    - name: joined params
      url: /foo?cow=moo
      query_parameters:
          bar: 1
      response_headers:
          x-gabbi-url: $SCHEME://$NETLOC/foo?cow=moo&bar=1

    - name: multi params
      url: /foo
      request_headers:
          accept: application/json
      query_parameters:
          bar:
            - 1
            - 2 
      response_headers:
          x-gabbi-url: $SCHEME://$NETLOC/foo?bar=1&bar=2
          content-type: application/json
      response_json_paths:
          $.bar[0]: "1"
          $.bar[1]: "2"

    - name: replacers in params
      url: /foo
      query_parameters:
          fromjson: $RESPONSE['$.bar[0]']
      response_headers:
          x-gabbi-url: $SCHEME://$NETLOC/foo?fromjson=1

    - name: unicode
      url: /foo
      query_parameters:
          snowman: ☃
      response_headers:
          x-gabbi-url: $SCHEME://$NETLOC/foo?snowman=%E2%98%83

    - name: url in param
      url: /foo
      query_parameters:
          redirect: http://example.com/treehouse?secret=true&password=hello
      response_headers:
          x-gabbi-url: $SCHEME://$NETLOC/foo?redirect=http%3A%2F%2Fexample.com%2Ftreehouse%3Fsecret%3Dtrue%26password%3Dhello