Beispiel #1
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
Beispiel #2
0
 def test_get_http_connection(self):
     sqs = Mock(name='sqs')
     x = AsyncConnection(sqs)
     assert isinstance(
         x.get_http_connection(),
         AsyncHTTPSConnection,
     )
     conn = x.get_http_connection()
     assert conn.http_client is x._httpclient
Beispiel #3
0
 def test_get_http_connection(self):
     sqs = Mock(name='sqs')
     x = AsyncConnection(sqs)
     assert isinstance(
         x.get_http_connection(),
         AsyncHTTPSConnection,
     )
     conn = x.get_http_connection()
     assert conn.http_client is x._httpclient