pytest_requests_futures package

Module contents

pytest_requests_futures.future_mock()[source]

Build a mock of an instance of a Future.

Creates a mock object, that behaves similar to a Future instance, given an http status code, which the client desires the mock to emulate.

The mock object is similar to the output of the MockFuturesSession.get method and has the single “result” ‘method’ that returns an object with the “status_code” property.

Parameters

status_code (int) – the http status code that the client desires the mock to return

Returns

an instance of a Futere Mock

Return type

FutureMock

pytest_requests_futures.future_session_mock(future_mock)[source]

Build a mock of an instance of a FutureSession.

Create a mock object that partially emulates the behaviour of a MockFuturesSession instance and “exposes” a mocked ‘get’ method.

pytest_requests_futures.future_session_mock_from_boolean(future_session_mock)[source]

Mock the FuturesSession class.

Get a mock of the FuturesSession class.

Parameters

found (bool) – whether to emulate the mock returning 200 or not as an http “status code”