test: refactoring:
- rename internal init methods to reinit
- rename getSentMessage to getSentMessageXml
- rename getSentMessageRaw to getSentMessage
This commit is contained in:
parent
a6e6cd68be
commit
852106becd
1 changed files with 115 additions and 95 deletions
|
|
@ -46,7 +46,7 @@ class XEP_0033Test(helpers.SatTestCase):
|
|||
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 @@ class XEP_0033Test(helpers.SatTestCase):
|
|||
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 @@ class XEP_0033Test(helpers.SatTestCase):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue