Mercurial > libervia-backend
comparison sat/test/test_plugin_xep_0033.py @ 2765:378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 11 Jan 2019 11:13:15 +0100 |
parents | 56f94936df1e |
children | 003b8b4b56a7 |
comparison
equal
deleted
inserted
replaced
2764:92af49cde255 | 2765:378188abe941 |
---|---|
143 helpers.muteLogging() | 143 helpers.muteLogging() |
144 d = self.host.findFeaturesSet([plugin.NS_ADDRESS], jid_=host, profile=PROFILE) | 144 d = self.host.findFeaturesSet([plugin.NS_ADDRESS], jid_=host, profile=PROFILE) |
145 d.addCallback(cb, to_jid) | 145 d.addCallback(cb, to_jid) |
146 d_list.append(d) | 146 d_list.append(d) |
147 | 147 |
148 def cb_list(dummy): | 148 def cb_list(__): |
149 msg = "/!\ see the comments in XEP_0033.sendAndStoreMessage" | 149 msg = "/!\ see the comments in XEP_0033.sendAndStoreMessage" |
150 sent_recipients = [ | 150 sent_recipients = [ |
151 JID(elt["to"]) for elt in self.host.getSentMessages(PROFILE_INDEX) | 151 JID(elt["to"]) for elt in self.host.getSentMessages(PROFILE_INDEX) |
152 ] | 152 ] |
153 self.assertEqualUnsortedList(sent_recipients, sent, msg) | 153 self.assertEqualUnsortedList(sent_recipients, sent, msg) |
185 # feature is supported by the main target server | 185 # feature is supported by the main target server |
186 self.host.reinit() | 186 self.host.reinit() |
187 self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE) | 187 self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE) |
188 data = self._get_mess_data() | 188 data = self._get_mess_data() |
189 d = self._trigger(data) | 189 d = self._trigger(data) |
190 return d.addCallback(lambda dummy: self._checkSentAndStored()) | 190 return d.addCallback(lambda __: self._checkSentAndStored()) |
191 | 191 |
192 def test_messageSendTriggerFeatureFullySupported(self): | 192 def test_messageSendTriggerFeatureFullySupported(self): |
193 # feature is supported by all target servers | 193 # feature is supported by all target servers |
194 self.host.reinit() | 194 self.host.reinit() |
195 self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE) | 195 self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE) |
196 for dest in (JID_STR_X_TO, JID_STR_X_CC, JID_STR_X_BCC): | 196 for dest in (JID_STR_X_TO, JID_STR_X_CC, JID_STR_X_BCC): |
197 self.host.addFeature(JID(JID(dest).host), plugin.NS_ADDRESS, PROFILE) | 197 self.host.addFeature(JID(JID(dest).host), plugin.NS_ADDRESS, PROFILE) |
198 data = self._get_mess_data() | 198 data = self._get_mess_data() |
199 d = self._trigger(data) | 199 d = self._trigger(data) |
200 return d.addCallback(lambda dummy: self._checkSentAndStored()) | 200 return d.addCallback(lambda __: self._checkSentAndStored()) |
201 | 201 |
202 def test_messageSendTriggerFixWrongEntity(self): | 202 def test_messageSendTriggerFixWrongEntity(self): |
203 # check that a wrong recipient entity is fixed by the backend | 203 # check that a wrong recipient entity is fixed by the backend |
204 self.host.reinit() | 204 self.host.reinit() |
205 self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE) | 205 self.host.addFeature(JID(JID_STR_TO), plugin.NS_ADDRESS, PROFILE) |
206 for dest in (JID_STR_X_TO, JID_STR_X_CC, JID_STR_X_BCC): | 206 for dest in (JID_STR_X_TO, JID_STR_X_CC, JID_STR_X_BCC): |
207 self.host.addFeature(JID(JID(dest).host), plugin.NS_ADDRESS, PROFILE) | 207 self.host.addFeature(JID(JID(dest).host), plugin.NS_ADDRESS, PROFILE) |
208 data = self._get_mess_data() | 208 data = self._get_mess_data() |
209 data["to"] = JID(JID_STR_X_TO) | 209 data["to"] = JID(JID_STR_X_TO) |
210 d = self._trigger(data) | 210 d = self._trigger(data) |
211 return d.addCallback(lambda dummy: self._checkSentAndStored()) | 211 return d.addCallback(lambda __: self._checkSentAndStored()) |