#NEWLINE# def test_notifyDisconnect_after_connection( self ) : #NEWLINE# #INDENT# "\n        The notifyDisconnect method returns a Deferred that fires when the\n        client has disconnected even if it's called after a connection is\n        established.\n        " #NEWLINE# self . successResultOf ( self . factory . connect ( ) ) #NEWLINE# d = self . factory . notifyDisconnect ( ) #NEWLINE# self . assertNoResult ( d ) #NEWLINE# self . endpoint . disconnect ( FakeDisconnectedError ( ) ) #NEWLINE# self . failureResultOf ( d , FakeDisconnectedError ) #NEWLINE# self . assertEqual ( len ( self . flushLoggedErrors ( FakeDisconnectedError ) ) , 1 )