Skip to content

Commit

Permalink
Merge pull request #24 from sileht/master
Browse files Browse the repository at this point in the history
Allow templating dict in response_json_paths
  • Loading branch information
cdent committed Mar 11, 2015
2 parents 858632b + 9e7a1b0 commit 72c706b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gabbi/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def test_request(self):

def replace_template(self, message):
"""Replace magic strings in message."""
if isinstance(message, dict):
for k in message:
message[k] = self.replace_template(message[k])
return message

for replacer in REPLACERS:
template = '$%s' % replacer
Expand Down
4 changes: 4 additions & 0 deletions gabbi/gabbits_intercept/backref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ tests:
data:
a: $RESPONSE['a']
c: $RESPONSE['link']
d:
z: $RESPONSE['b']
response_json_paths:
a: $RESPONSE['a']
c: /v2
d:
z: $RESPONSE['b']
response_headers:
x-gabbi-url: $SCHEME://$NETLOC/v2

Expand Down

0 comments on commit 72c706b

Please sign in to comment.