#NEWLINE# def test_nickConflict( self ) : #NEWLINE# #INDENT# '\n        If the server finds the new nick in conflict, the errback is called.\n        ' #NEWLINE# def cb( failure , room ) : #NEWLINE# #INDENT# user = room . getUser ( otherNick ) #NEWLINE# self . assertNotIdentical ( None , user ) #NEWLINE# self . assertEqual ( otherJID , user . entity ) #NEWLINE# #UNINDENT# def joined( room ) : #NEWLINE# #INDENT# d = self . protocol . nick ( room . roomJID , otherNick ) #NEWLINE# self . assertFailure ( d , StanzaError ) #NEWLINE# d . addCallback ( cb , room ) #NEWLINE# #UNINDENT# otherJID = JID ( 'other@example.org/Home' ) #NEWLINE# otherNick = 'otherNick' #NEWLINE# d = self . protocol . join ( self . roomJID , self . nick ) #NEWLINE# d . addCallback ( self ) #NEWLINE# xml = ( "\n            <presence from='%s/%s'>\n              <x xmlns='http://jabber.org/protocol/muc#user'>\n                <item affiliation='member' role='participant' jid='%s'/>\n              </x>\n            </presence>\n        " % ( self . roomJID , otherNick , otherJID ) ) #NEWLINE# self . stub . send ( parseXml ( xml ) ) #NEWLINE# xml = ( "\n            <presence from='%s/%s'>\n              <x xmlns='http://jabber.org/protocol/muc#user'>\n                <item affiliation='member' role='participant'/>\n              </x>\n            </presence>\n        " % ( self . roomJID , self . nick ) ) #NEWLINE# self . stub . send ( parseXml ( xml ) ) #NEWLINE# xml = ( "\n            <presence from='%s/%s' type='error'>\n                <x xmlns='http://jabber.org/protocol/muc'/>\n                <error type='cancel'>\n                  <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n                </error>\n            </presence>\n        " % ( self . roomJID , otherNick ) ) #NEWLINE# self . stub . send ( parseXml ( xml ) ) #NEWLINE# return d