Example #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())
Example #2
0
 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)
Example #3
0
 def test_getCommand(self):
     iq = self.iq
     cmd2 = command.getCommand(iq)
     self.assertTrue(cmd2 is None)