From 9fbddc69e964cea75c2a1a929d40e24cbe0dc16c Mon Sep 17 00:00:00 2001 From: souliane Date: Wed, 17 Sep 2014 10:02:24 +0200 Subject: [PATCH] test: fixes FakeSAT for plugin XEP-0033 --- src/test/helpers.py | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/test/helpers.py b/src/test/helpers.py index ae12ea54..50ca8de3 100644 --- a/src/test/helpers.py +++ b/src/test/helpers.py @@ -84,12 +84,31 @@ class FakeSAT(object): def sendMessage(self, to_s, msg, subject=None, mess_type='auto', extra={}, profile_key='@NONE@'): self.sendAndStoreMessage({"to": JID(to_s)}) - def sendAndStoreMessage(self, mess_data, skip_send=False, profile=None): - """Save the information to check later to whom messages have been sent and - if entries have been added to the history""" - if not skip_send: - self.sent_messages.append(mess_data["to"]) + def _sendMessageToStream(self, mess_data, client): + """Save the information to check later to whom messages have been sent. + + @param mess_data: message data dictionnary + @param client: profile's client + """ + self.sent_messages.append(mess_data["to"]) + return mess_data + + def _storeMessage(self, mess_data, client): + """Save the information to check later if entries have been added to the history. + + @param mess_data: message data dictionnary + @param client: profile's client + """ self.stored_messages.append(mess_data["to"]) + return mess_data + + def sendMessageToBridge(self, mess_data, client): + """Simulate the message being sent to the frontends. + + @param mess_data: message data dictionnary + @param client: profile's client + """ + return mess_data # TODO def getClient(self, profile_key): """Convenient method to get client from profile key