#NEWLINE# def test_notifyDisconnect( self ) : #NEWLINE# #INDENT# '\n        The notifyDisconnect method returns a Deferred that fires when the\n        client has disconnected.\n        ' #NEWLINE# d = self . factory . notifyDisconnect ( ) #NEWLINE# self . successResultOf ( self . factory . connect ( ) ) #NEWLINE# self . assertNoResult ( d ) #NEWLINE# self . endpoint . disconnect ( FakeDisconnectedError ( ) ) #NEWLINE# self . failureResultOf ( d , FakeDisconnectedError ) #NEWLINE# self . assertEqual ( len ( self . flushLoggedErrors ( FakeDisconnectedError ) ) , 1 )