'Fake implementation of an endpoint which synchronously
succeeds with an instance of L{StubHTTPProtocol} for ease of
testing.'

def connect(self, factory):

    protocol = StubHTTPProtocol()
    protocol.makeConnection(None)
    self.protocol = protocol
    return succeed(protocol)
