
As part of review [1] the openstack build system assumes the layout of the docs directories to be doc/build. This is not what requests-mock was producing. Fix the docs building directories to make it work with the build system again. [1] Icb0c02dc5b6f7b5e248e0df6d6093c29535b08f3 Closes-Bug: #1630114 Change-Id: Iea93ecfb0506d5ccd0b79ad35f5677797fadf730
16 lines
966 B
ReStructuredText
16 lines
966 B
ReStructuredText
========
|
|
Overview
|
|
========
|
|
|
|
The `requests`_ library has the concept of `pluggable transport adapters`_.
|
|
These adapters allow you to register your own handlers for different URIs or protocols.
|
|
|
|
The *requests-mock* library at its core is simply a transport adapter that can be preloaded with responses that are returned if certain URIs are requested.
|
|
This is particularly useful in unit tests where you want to return known responses from HTTP requests without making actual calls.
|
|
|
|
As the `requests`_ library has very limited options for how to load and use adapters *requests-mock* also provides a number of ways to make sure the mock adapter is used.
|
|
These are only loading mechanisms, they do not contain any logic and can be used as a reference to load the adapter in whatever ways works best for your project.
|
|
|
|
.. _requests: http://python-requests.org
|
|
.. _pluggable transport adapters: http://docs.python-requests.org/en/latest/user/advanced/#transport-adapters
|