'The pool\'s C{_newConnection} method constructs a new connection.'

def test_newConnection(self):

    protocol = StubHTTPProtocol()
    protocol.makeConnection(StringTransport())
    key = 12245
    self.pool._putConnection(key, protocol)
    def gotConnection(newConnection):
        self.assertNotIdentical(protocol, newConnection)
        self.assertIn(protocol, self.pool._connections[key])
        self.assertNotIn(newConnection, self.pool._connections.values())
    d = self.pool._newConnection(key, DummyEndpoint())
    return d.addCallback(gotConnection)
