@mock.patch.object(requests, '__build__', 0x020500)
@mock.patch.object(poolmanager, 'PoolManager')
def test_keep_alive_on_newer_requests_no_idle(PoolManager):
    socket_opts = [
        (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1),
        (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
        (socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 10),
        (socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 10),
    ]
    with remove_keepidle():
        adapter = socket_options.TCPKeepAliveAdapter(
            idle=30, interval=10, count=10,
            pool_connections=10,
            pool_maxsize=5,
            pool_block=True,
        )
    PoolManager.assert_called_once_with(
        num_pools=10, maxsize=5, block=True,
        socket_options=socket_opts
    )
    assert adapter.socket_options == socket_opts
Show that options are generated correctly from kwargs.
dataset/ETHPy150Open sigmavirus24/requests-toolbelt/tests/test_socket_options_adapter.py/test_keep_alive_on_newer_requests_no_idle