def test_get_client(self, hub): pytest.importorskip('pycurl') client = http.get_client() assert client.hub is hub client2 = http.get_client(hub) assert client2 is client assert client2.hub is hub
def test_client(self): sqs = Mock(name='sqs') x = AsyncConnection(sqs) assert x._httpclient is http.get_client() client = Mock(name='client') y = AsyncConnection(sqs, http_client=client) assert y._httpclient is client
def __init__(self, strict=None, timeout=20.0, http_client=None): self.headers = [] self.timeout = timeout self.strict = strict self.http_client = http_client or get_client()
def __init__(self, sqs_connection, http_client=None, **kwargs): # noqa self.sqs_connection = sqs_connection self._httpclient = http_client or get_client()
def test_http_client(self): x = AsyncHTTPSConnection() assert x.http_client is http.get_client() client = Mock(name='http_client') y = AsyncHTTPSConnection(http_client=client) assert y.http_client is client
def test_get_client(self, hub): client = http.get_client() assert client.hub is hub client2 = http.get_client(hub) assert client2 is client assert client2.hub is hub