'If L{client.HTTPConnectionPool.getConnection} returns a previously
cached connection, it will get wrapped in a
L{client._RetryingHTTP11ClientProtocol}.'

def test_wrappedOnPersistentReturned(self):

    pool = client.HTTPConnectionPool(Clock())
    protocol = StubHTTPProtocol()
    protocol.makeConnection(StringTransport())
    pool._putConnection(123, protocol)
    d = pool.getConnection(123, DummyEndpoint())
    def gotConnection(connection):
        self.assertIsInstance(connection, client._RetryingHTTP11ClientProtocol)
        self.assertIdentical(connection._clientProtocol, protocol)
    return d.addCallback(gotConnection)
