#NEWLINE# def connect( self , onLogin ) : #NEWLINE# #INDENT# deferred = self . transport . connect ( ( 'username' , 'password' ) ) #NEWLINE# deferred . addCallbacks ( onLogin , onLogin ) #NEWLINE# loginRequest = self . serverChannel . get ( ) #NEWLINE# self . assertEqual ( loginRequest , 'CONNECT:username,password' ) #NEWLINE# self . serverChannel . write ( 'CONNECT:OK,username,user_id,display name,fake_auth_token' )