def test_options_not_passed_on_older_requests(PoolManager):
    """Show that options are not passed for older versions of requests."""
    fake_opts = [('test', 'options', 'fake')]
    socket_options.SocketOptionsAdapter(
        socket_options=fake_opts,
        pool_connections=10,
        pool_maxsize=5,
        pool_block=True,
    )
    assert PoolManager.called is False
def test_options_passing_on_newer_requests(PoolManager):
    """Show that options are passed for a new enough version of requests."""
    fake_opts = [('test', 'options', 'fake')]
    adapter = socket_options.SocketOptionsAdapter(
        socket_options=fake_opts,
        pool_connections=10,
        pool_maxsize=5,
        pool_block=True,
    )
    PoolManager.assert_called_once_with(num_pools=10,
                                        maxsize=5,
                                        block=True,
                                        socket_options=fake_opts)
    assert adapter.socket_options == fake_opts