diff src/test/test_plugin_xep_0033.py @ 1271:2308f8405ffb

test: refactoring: - rename internal init methods to reinit - rename getSentMessage to getSentMessageXml - rename getSentMessageRaw to getSentMessage
author souliane <souliane@mailoo.org>
date Fri, 19 Dec 2014 11:36:00 +0100
parents 7ea0215e7092
children 7fbc858cd1cd
line wrap: on
line diff
--- a/src/test/test_plugin_xep_0033.py	Mon Dec 15 15:29:08 2014 +0100
+++ b/src/test/test_plugin_xep_0033.py	Fri Dec 19 11:36:00 2014 +0100
@@ -46,7 +46,7 @@
         self.plugin = plugin.XEP_0033(self.host)
 
     def test_messageReceived(self):
-        self.host.memory.init()
+        self.host.memory.reinit()
         xml = u"""
         <message type="chat" from="%s" to="%s" id="test_1">
             <body>test</body>
@@ -148,21 +148,19 @@
             post_treatments.addCallbacks(assertAddresses, lambda failure: sendMessageErrback(failure, exception))
 
         # feature is not supported, abort the message
-        self.host.memory.init()
         data = deepcopy(mess_data)
         trigger(data, CancelError)
+        self.host.memory.reinit()
 
         # feature is supported by the main target server
-        self.host.init()
-        self.host.memory.init()
+        self.host.reinit()
         self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE)
         data = deepcopy(mess_data)
         trigger(data, CancelError)
         checkSentAndStored()
 
         # feature is supported by all target servers
-        self.host.init()
-        self.host.memory.init()
+        self.host.reinit()
         self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE)
         for dest in (JID_STR_X_TO, JID_STR_X_CC, JID_STR_X_BCC):
             self.host.addFeature(JID(JID(dest).host), plugin.NS_ADDRESS, PROFILE)
@@ -171,8 +169,7 @@
         checkSentAndStored()
 
         # check that a wrong recipient entity is fixed by the backend
-        self.host.init()
-        self.host.memory.init()
+        self.host.reinit()
         self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE)
         for dest in (JID_STR_X_TO, JID_STR_X_CC, JID_STR_X_BCC):
             self.host.addFeature(JID(JID(dest).host), plugin.NS_ADDRESS, PROFILE)