#NEWLINE# def test_connect( self ) : #NEWLINE# #INDENT# '\n        The connect method returns a Deferred that fires when the connection is\n        established.\n        ' #NEWLINE# self . endpoint . deferred = defer . Deferred ( ) #NEWLINE# d = self . factory . connect ( ) #NEWLINE# self . assertNoResult ( d ) #NEWLINE# self . endpoint . deferred . callback ( self . factory . buildProtocol ( None ) ) #NEWLINE# self . successResultOf ( d )