

def test_acquire_send(self):
    pool = Pool(url='ws://localhost:8182/', maxsize=2, username='stephen', password='password', loop=self.loop, future_class=Future)

    @trollius.coroutine
    def go():
        connection = (yield From(pool.acquire()))
        resp = connection.send('1 + 1')
        while True:
            msg = (yield From(resp.read()))
            if (msg is None):
                break
            self.assertEqual(msg.status_code, 200)
            self.assertEqual(msg.data[0], 2)
        connection.conn.close()
    self.loop.run_until_complete(go())

dataset/ETHPy150Open davebshow/gremlinclient/tests/test_trollius.py TrolliusPoolTest.test_acquire_send/original