[doc] cb_kwargs contract

This commit is contained in:
Eugenio Lacuesta 2019-08-31 02:10:18 -03:00
parent eb0bd2daef
commit 2061f2a382
No known key found for this signature in database
GPG Key ID: DA3EF2D0913E9810
1 changed files with 9 additions and 1 deletions

View File

@ -35,12 +35,20 @@ This callback is tested using three built-in contracts:
.. class:: UrlContract
This contract (``@url``) sets the sample url used when checking other
This contract (``@url``) sets the sample URL used when checking other
contract conditions for this spider. This contract is mandatory. All
callbacks lacking this contract are ignored when running the checks::
@url url
.. class:: CallbackKeywordArgumentsContract
This contract (``@cb_kwargs``) sets the :attr:`cb_kwargs <scrapy.http.Request.cb_kwargs>`
attribute for the sample request. It must be a valid JSON dictionary.
::
@cb_kwargs {"arg1": "value1", "arg2": "value2", ...}
.. class:: ReturnsContract
This contract (``@returns``) sets lower and upper bounds for the items and