Bases: requests.adapters.BaseAdapter
A fake adapter than can return predefined responses.
Register a custom matcher.
A matcher is a callable that takes a requests.Request and returns a requests.Response if it matches or None if not.
Parameters: | matcher (callable) – The matcher to execute. |
---|
Bases: exceptions.Exception
Base Exception for library
Bases: requests_mock.exceptions.MockException
The requested URL was not mocked
Bases: requests.adapters.BaseAdapter
A fake adapter than can return predefined responses.
Register a custom matcher.
A matcher is a callable that takes a requests.Request and returns a requests.Response if it matches or None if not.
Parameters: | matcher (callable) – The matcher to execute. |
---|
Retrieve the latest request sent
Register a new URI match and fake response.
Parameters: |
|
---|
Bases: requests_mock.mocker.MockerCore
The standard entry point for mock Adapter loading.
Bases: object
A wrapper around common mocking functions.
Automate the process of mocking the requests library. This will keep the same general options available and prevent repeating code.
Start mocking requests.
Install the adapter and the wrappers required to intercept requests.
Stop mocking requests.
This should have no impact if mocking has not been started.
Bases: exceptions.Exception
Base Exception for library
Bases: requests_mock.exceptions.MockException
The requested URL was not mocked