Skip to content

Commit

Permalink
minor doc clean up (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
beliaev-maksim committed Mar 17, 2022
1 parent 59330b7 commit 5634ec9
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ The following attributes can be passed to a Response mock:
method (``str``)
The HTTP method (GET, POST, etc).

url (``str`` or compiled regular expression)
url (``str`` or ``compiled regular expression``)
The full resource URL.

match_querystring (``bool``)
Expand Down Expand Up @@ -172,8 +172,9 @@ stream (``bool``)
auto_calculate_content_length (``bool``)
Disabled by default. Automatically calculates the length of a supplied string or JSON body.

match (``list``)
A list of callbacks to match requests based on request attributes.
match (``tuple``)
An iterable (``tuple`` is recommended) of callbacks to match requests
based on request attributes.
Current module provides multiple matchers that you can use to match:

* body contents in JSON format
Expand Down Expand Up @@ -817,8 +818,8 @@ the ``assert_all_requests_are_fired`` value:
body='{}', status=200,
content_type='application/json')
assert_call_count
-----------------
Assert Request Call Count
-------------------------

Assert that the request was called exactly n times.

Expand Down Expand Up @@ -866,13 +867,13 @@ You can also add multiple responses for the same url:
Using a callback to modify the response
---------------------------------------

If you use customized processing in `requests` via subclassing/mixins, or if you
have library tools that interact with `requests` at a low level, you may need
If you use customized processing in ``requests`` via subclassing/mixins, or if you
have library tools that interact with ``requests`` at a low level, you may need
to add extended processing to the mocked Response object to fully simulate the
environment for your tests. A `response_callback` can be used, which will be
environment for your tests. A ``response_callback`` can be used, which will be
wrapped by the library before being returned to the caller. The callback
accepts a `response` as it's single argument, and is expected to return a
single `response` object.
accepts a ``response`` as it's single argument, and is expected to return a
single ``response`` object.

.. code-block:: python
Expand Down Expand Up @@ -916,7 +917,7 @@ need to allow an entire domain or path subtree to send requests:
responses.add_passthru(re.compile('https://percy.io/\\w+'))
Lastly, you can use the `response.passthrough` attribute on `BaseResponse` or
Lastly, you can use the ``response.passthrough`` attribute on ``BaseResponse`` or
use ``PassthroughResponse`` to enable a response to behave as a pass through.

.. code-block:: python
Expand Down

0 comments on commit 5634ec9

Please sign in to comment.