コード例 #1
0
 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
コード例 #2
0
ファイル: test_connection.py プロジェクト: hakuokada/kombu
 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
コード例 #3
0
ファイル: test_connection.py プロジェクト: Scalr/kombu
 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
コード例 #4
0
 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()
コード例 #5
0
 def __init__(self, sqs_connection, http_client=None, **kwargs):  # noqa
     self.sqs_connection = sqs_connection
     self._httpclient = http_client or get_client()
コード例 #6
0
ファイル: test_connection.py プロジェクト: hakuokada/kombu
 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
コード例 #7
0
ファイル: test_http.py プロジェクト: Deepakdubey90/Kombu
 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
コード例 #8
0
ファイル: connection.py プロジェクト: cloudera/hue
 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()
コード例 #9
0
ファイル: connection.py プロジェクト: cloudera/hue
 def __init__(self, sqs_connection, http_client=None, **kwargs):  # noqa
     self.sqs_connection = sqs_connection
     self._httpclient = http_client or get_client()
コード例 #10
0
ファイル: test_http.py プロジェクト: Scalr/kombu
 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
コード例 #11
0
ファイル: test_connection.py プロジェクト: Scalr/kombu
 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