#NEWLINE# def test_leave( self ) : #NEWLINE# #INDENT# '\n        Client leaves a room\n        ' #NEWLINE# def joined( _ ) : #NEWLINE# #INDENT# return self . protocol . leave ( self . roomJID ) #NEWLINE# #UNINDENT# d = self . protocol . join ( self . roomJID , self . nick ) #NEWLINE# d . addCallback ( joined ) #NEWLINE# xml = ( "\n            <presence to='%s' from='%s'/>\n        " % ( self . userJID , self . occupantJID ) ) #NEWLINE# self . stub . send ( parseXml ( xml ) ) #NEWLINE# element = self . stub . output [ ( - 1 ) ] #NEWLINE# self . assertEquals ( 'unavailable' , element [ 'type' ] , 'Unavailable is not being sent' ) #NEWLINE# xml = ( "\n            <presence to='%s' from='%s' type='unavailable'/>\n        " % ( self . userJID , self . occupantJID ) ) #NEWLINE# self . stub . send ( parseXml ( xml ) ) #NEWLINE# return d