comparison src/test/helpers.py @ 1206:020e663bc286

test: fixes FakeSAT for plugin XEP-0033
author souliane <souliane@mailoo.org>
date Wed, 17 Sep 2014 10:02:24 +0200
parents 6e975c6b0faf
children 91e5becc6623 be3a301540c0
comparison
equal deleted inserted replaced
1205:3e234902177a 1206:020e663bc286
82 pass 82 pass
83 83
84 def sendMessage(self, to_s, msg, subject=None, mess_type='auto', extra={}, profile_key='@NONE@'): 84 def sendMessage(self, to_s, msg, subject=None, mess_type='auto', extra={}, profile_key='@NONE@'):
85 self.sendAndStoreMessage({"to": JID(to_s)}) 85 self.sendAndStoreMessage({"to": JID(to_s)})
86 86
87 def sendAndStoreMessage(self, mess_data, skip_send=False, profile=None): 87 def _sendMessageToStream(self, mess_data, client):
88 """Save the information to check later to whom messages have been sent and 88 """Save the information to check later to whom messages have been sent.
89 if entries have been added to the history""" 89
90 if not skip_send: 90 @param mess_data: message data dictionnary
91 self.sent_messages.append(mess_data["to"]) 91 @param client: profile's client
92 """
93 self.sent_messages.append(mess_data["to"])
94 return mess_data
95
96 def _storeMessage(self, mess_data, client):
97 """Save the information to check later if entries have been added to the history.
98
99 @param mess_data: message data dictionnary
100 @param client: profile's client
101 """
92 self.stored_messages.append(mess_data["to"]) 102 self.stored_messages.append(mess_data["to"])
103 return mess_data
104
105 def sendMessageToBridge(self, mess_data, client):
106 """Simulate the message being sent to the frontends.
107
108 @param mess_data: message data dictionnary
109 @param client: profile's client
110 """
111 return mess_data # TODO
93 112
94 def getClient(self, profile_key): 113 def getClient(self, profile_key):
95 """Convenient method to get client from profile key 114 """Convenient method to get client from profile key
96 @return: client or None if it doesn't exist""" 115 @return: client or None if it doesn't exist"""
97 profile = self.memory.getProfileName(profile_key) 116 profile = self.memory.getProfileName(profile_key)