Ignore:
Timestamp:
Aug 15, 2011, 5:39:17 PM (10 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
wokkel-muc-client-support-24
Message:

Reimplement RegisterRequest? by generalizing the form handling for room config.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_muc.py

    r150 r151  
    559559        """
    560560
    561         # FIXME: this doesn't really test the registration
    562 
    563561        def cb(iq):
    564562            # check for a result
    565563            self.assertEquals('result', iq['type'], 'We did not get a result')
    566564
    567         d = self.protocol.register(self.roomJID)
    568         d.addCallback(cb)
    569 
    570         iq = self.stub.output[-1]
    571         query = "/iq/query[@xmlns='%s']" % muc.NS_REQUEST
    572         self.assertTrue(xpath.matches(query, iq), 'Invalid iq register request')
     565        d = self.protocol.register(self.roomJID,
     566                                   {'muc#register_roomnick': 'thirdwitch'})
     567        d.addCallback(cb)
     568
     569        iq = self.stub.output[-1]
     570
     571        query = "/iq/query[@xmlns='%s']" % muc.NS_REGISTER
     572        nodes = xpath.queryForNodes(query, iq)
     573        self.assertNotIdentical(None, nodes, 'Invalid registration request')
     574
     575        form = data_form.findForm(nodes[0], muc.NS_MUC_REGISTER)
     576        self.assertNotIdentical(None, form, 'Missing registration form')
     577        self.assertEquals('submit', form.formType)
     578        self.assertIn('muc#register_roomnick', form.fields)
     579
    573580
    574581        response = toResponse(iq, 'result')
Note: See TracChangeset for help on using the changeset viewer.