comparison src/test/test_plugin_xep_0085.py @ 924:861593a5652b

test: fix tests fo plugins XEP-0033 and XEP-0085
author souliane <souliane@mailoo.org>
date Sat, 22 Mar 2014 18:47:17 +0100
parents 6f96ee4d8cc0
children 87fbe4640448
comparison
equal deleted inserted replaced
923:e77948faaef3 924:861593a5652b
69 ("<body>%s</body>" % mess_data['message']) if state == "active" else "") 69 ("<body>%s</body>" % mess_data['message']) if state == "active" else "")
70 mess_data['xml'] = parseXml(stanza.encode("utf-8")) 70 mess_data['xml'] = parseXml(stanza.encode("utf-8"))
71 expected = deepcopy(mess_data['xml']) 71 expected = deepcopy(mess_data['xml'])
72 expected.addElement(state, plugin.NS_CHAT_STATES) 72 expected.addElement(state, plugin.NS_CHAT_STATES)
73 treatments = defer.Deferred() 73 treatments = defer.Deferred()
74 self.plugin.sendMessageTrigger(mess_data, treatments, Const.PROFILE[0]) 74 self.plugin.sendMessageTrigger(mess_data, defer.Deferred(), treatments, Const.PROFILE[0])
75 xml = treatments.callbacks[0][0][0](mess_data) 75 xml = treatments.callbacks[0][0][0](mess_data)
76 # cancel the timer to not block the process 76 # cancel the timer to not block the process
77 self.plugin.map[Const.PROFILE[0]][Const.JID[0].userhostJID()].timer.cancel() 77 self.plugin.map[Const.PROFILE[0]][Const.JID[0].userhostJID()].timer.cancel()
78 self.assertEqualXML(xml['xml'].toXml().encode("utf-8"), expected.toXml().encode("utf-8")) 78 self.assertEqualXML(xml['xml'].toXml().encode("utf-8"), expected.toXml().encode("utf-8"))