Changeset 111:a51e5d87ded8 for wokkel/test/test_muc.py
- Timestamp:
- Oct 3, 2008, 8:50:37 PM (14 years ago)
- Branch:
- wokkel-muc-client-support-24
- Convert:
- svn:b33ecbfc-034c-dc11-8662-000475d9059e/branches/wokkel-muc-client-support-24@72
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wokkel/test/test_muc.py
r110 r111 227 227 228 228 def test_privateMessage(self): 229 229 230 self.fail('Not Implemented') 230 231 231 232 def test_register(self): 232 self.fail('Not Implemented') 233 """Test client registering with a room. http://xmpp.org/extensions/xep-0045.html#register 234 235 """ 236 237 def cb(iq): 238 # check for a result 239 self.failUnless(iq['type']=='result', 'We did not get a result') 240 241 d = self.protocol.register(self.room_jid.userhost()) 242 d.addCallback(cb) 243 244 iq = self.stub.output[-1] 245 246 self.failUnless(xpath.matches("/iq/query[@xmlns='%s']" % (muc.NS_REQUEST), iq), 'Invalid iq register request') 247 248 response = toResponse(iq, 'result') 249 self.stub.send(response) 250 return d 233 251 234 252 def test_voice(self): 235 253 """ 254 """ 236 255 self.protocol.voice(self.room_jid.userhost()) 237 256 238 257 m = self.stub.output[-1] 239 self.failUnless(m.name=='message', "Need to be message stanza") 240 self.failUnless(getattr(m, 'x', None), 'No muc x element') 241 258 242 259 self.failUnless(xpath.matches("/message/x[@type='submit']/field/value[text()='%s']" % (muc.NS_REQUEST,), m), 'Invalid voice message stanza') 243 260 244 261 245 262 def test_roomConfigure(self): 246 247 self.fail('Not Implemented') 248 249 263 """ 264 """ 265 266 def cb(iq): 267 self.failUnless(iq['type']=='result', 'Not a result') 268 269 270 fields = [] 271 272 fields.append(data_form.Field(label='Natural-Language Room Name', 273 var='muc#roomconfig_roomname', 274 value=self.test_room)) 275 276 d = self.protocol.configure(self.room_jid.userhost(), fields) 277 d.addCallback(cb) 278 279 iq = self.stub.output[-1] 280 self.failUnless(xpath.matches("/iq/query[@xmlns='%s']/x"% (muc.NS_OWNER,), iq), 'Bad configure request') 281 282 response = toResponse(iq, 'result') 283 self.stub.send(response) 284 return d 285 286
Note: See TracChangeset
for help on using the changeset viewer.