Skip to content

Commit

Permalink
Enable $RESPONSE handling in response_headers
Browse files Browse the repository at this point in the history
Because the other replacers do too.
  • Loading branch information
cdent committed Feb 13, 2015
1 parent 9c23732 commit b694932
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ are replaced with real values during test processing.
* ``$LOCATION``: The location header returned in the prior response.
Availble in field ``url``.
* ``$RESPONSE['<json path>']``: A JSONPath query into the prior
response. Available in fields ``url``, ``response_strings`` and
``response_json_paths``
response. Available in fields ``url``, ``response_strings``,
``response_json_paths`` and ``response_headers``.
* ``$HEADERS['<header>']``: Indicate the name of a header from the
prior response to inject in the value. Available in fields ``url``,
``response_strings``, ``response_strings`` and ``response_headers``.
Expand Down
1 change: 1 addition & 0 deletions gabbi/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def _test_headers(self, headers, response):
for header in headers:
header_value = headers[header].replace('$SCHEME', self.scheme)
header_value = header_value.replace('$NETLOC', self.netloc)
header_value = self._replace_response_values(header_value)
header_value = self._replace_header_values(header_value)

try:
Expand Down
1 change: 1 addition & 0 deletions gabbi/gabbits_intercept/backref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ tests:
- '"a": "$RESPONSE[''a'']"'
- '"c": "/v2"'
response_headers:
location: $SCHEME://$NETLOC$RESPONSE['c']
x-gabbi-url: $SCHEME://$NETLOC/v2
content-type: $HEADERS['content-type']

0 comments on commit b694932

Please sign in to comment.