mirror of https://github.com/zulip/zulip.git
writing-bots.md: Add fixture JSON skeleton.
This commit is contained in:
parent
7d977dd059
commit
12e7e2557e
|
@ -464,7 +464,22 @@ following helper method:
|
|||
# self.assert_bot_response(...)
|
||||
|
||||
`mock_http_conversation(fixture_name)` patches `requests.get` and returns the data specified
|
||||
in the file `fixtures/<fixture_name>.py`. For an example, check out the [giphy bot](
|
||||
in the file `fixtures/<fixture_name>.json`. Use the following JSON code as a skeleton for new
|
||||
fixtures:
|
||||
```
|
||||
{
|
||||
"request": {
|
||||
"api_url": "http://api.example.com/",
|
||||
"params": {
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
},
|
||||
"response-headers": {
|
||||
}
|
||||
}
|
||||
```
|
||||
For an example, check out the [giphy bot](
|
||||
https://github.com/zulip/python-zulip-api/tree/master/zulip_bots/zulip_bots/bots/giphy).
|
||||
|
||||
*Tip: You can use [requestb.in](http://requestb.in) or a similar tool to capture payloads from the
|
||||
|
|
Loading…
Reference in New Issue