comparison src/test/helpers.py @ 849:c5a8f602662b

plugin room_game, radiocol: RoomGame.send returns a Deferred.
author souliane <souliane@mailoo.org>
date Tue, 18 Feb 2014 17:49:33 +0100
parents 9bac2fc74968
children 64ec04991d9d
comparison
equal deleted inserted replaced
848:d40306d1da70 849:c5a8f602662b
311 self.sent = [] 311 self.sent = []
312 312
313 def send(self, obj): 313 def send(self, obj):
314 """Save the sent messages to compare them later""" 314 """Save the sent messages to compare them later"""
315 self.sent.append(obj) 315 self.sent.append(obj)
316 return defer.succeed(None)
316 317
317 318
318 class FakeClient(object): 319 class FakeClient(object):
319 """Tests involving more than one profile need one instance of this class per profile""" 320 """Tests involving more than one profile need one instance of this class per profile"""
320 321
325 self.roster = FakeRosterProtocol(host, self) 326 self.roster = FakeRosterProtocol(host, self)
326 self.client_initialized = defer.Deferred() 327 self.client_initialized = defer.Deferred()
327 self.xmlstream = FakeXmlStream() 328 self.xmlstream = FakeXmlStream()
328 329
329 def send(self, obj): 330 def send(self, obj):
330 self.xmlstream.send(obj) 331 return self.xmlstream.send(obj)
331 332
332 333
333 class SatTestCase(unittest.TestCase): 334 class SatTestCase(unittest.TestCase):
334 335
335 def assertEqualXML(self, xml, expected, ignore_blank=False): 336 def assertEqualXML(self, xml, expected, ignore_blank=False):