#NEWLINE# def test_getRegisterForm( self ) : #NEWLINE# #INDENT# '\n        The response of a register form request should extract the form.\n        ' #NEWLINE# def cb( form ) : #NEWLINE# #INDENT# self . assertEquals ( 'form' , form . formType ) #NEWLINE# #UNINDENT# d = self . protocol . getRegisterForm ( self . roomJID ) #NEWLINE# d . addCallback ( cb ) #NEWLINE# iq = self . stub . output [ ( - 1 ) ] #NEWLINE# query = ( "/iq/query[@xmlns='%s']" % muc . NS_REGISTER ) #NEWLINE# nodes = xpath . queryForNodes ( query , iq ) #NEWLINE# self . assertNotIdentical ( None , nodes , 'Missing query element' ) #NEWLINE# self . assertRaises ( StopIteration , nodes [ 0 ] . elements ( ) . next ) #NEWLINE# xml = ( "\n            <iq from='%s' id='%s' to='%s' type='result'>\n              <query xmlns='jabber:iq:register'>\n                <x xmlns='jabber:x:data' type='form'>\n                  <field type='hidden'\n                         var='FORM_TYPE'>\n                    <value>http://jabber.org/protocol/muc#register</value>\n                  </field>\n                  <field label='Desired Nickname'\n                         type='text-single'\n                         var='muc#register_roomnick'>\n                    <required/>\n                  </field>\n                </x>\n              </query>\n            </iq>\n        " % ( self . roomJID , iq [ 'id' ] , self . userJID ) ) #NEWLINE# self . stub . send ( parseXml ( xml ) ) #NEWLINE# return d