File: test_http_adapter_with_socket_options.py

package info (click to toggle)
azure-kusto-python 5.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,704 kB
  • sloc: python: 10,633; sh: 13; makefile: 3
file content (13 lines) | stat: -rw-r--r-- 436 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License
import pickle
import socket

from azure.kusto.data.client import HTTPAdapterWithSocketOptions


def test_pickle():
    socket_options = [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)]
    original = HTTPAdapterWithSocketOptions(socket_options=socket_options)
    unpickled = pickle.loads(pickle.dumps(original))
    assert unpickled.socket_options == socket_options