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