示例#1
0
    def test_getCommand(self):
        iq = self.iq
        cmd = Command(node='test', action='execute')
        iq.addChild(cmd.toElement())

        cmd2 = command.getCommand(iq)
        self.assertEquals(cmd2.toElement().toXml(), cmd.toElement().toXml())
示例#2
0
文件: pageManager.py 项目: wyn/collab
 def cancel_page(self, iq, s):
     self.reset()
     response = xmlstream.toResponse(stanza=iq, stanzaType='result')
     cmd = getCommand(iq)
     cmd.status = 'canceled'
     response.addChild(cmd.toElement())
     return defer.succeed(response)
示例#3
0
 def test_getCommand(self):
     iq = self.iq
     cmd2 = command.getCommand(iq)
     self.assertTrue(cmd2 is None)