示例#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
 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
 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
 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
 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
 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
 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
 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