plugin room_game, radiocol: RoomGame.send returns a Deferred.

This commit is contained in:
souliane 2014-02-18 17:49:33 +01:00
commit 7c29b8c566
2 changed files with 16 additions and 13 deletions

View file

@ -313,6 +313,7 @@ class FakeXmlStream(object):
def send(self, obj):
"""Save the sent messages to compare them later"""
self.sent.append(obj)
return defer.succeed(None)
class FakeClient(object):
@ -327,7 +328,7 @@ class FakeClient(object):
self.xmlstream = FakeXmlStream()
def send(self, obj):
self.xmlstream.send(obj)
return self.xmlstream.send(obj)
class SatTestCase(unittest.TestCase):

View file

@ -30,6 +30,7 @@ from constants import Const
from twisted.words.protocols.jabber.jid import JID
from twisted.words.xish import domish
from twisted.internet import reactor
from twisted.internet import defer
from twisted.python.failure import Failure
from mutagen.oggvorbis import OggVorbis
@ -381,6 +382,8 @@ class RadiocolTest(helpers.SatTestCase):
for filename in self.playlist:
self.plugin.deleteFile('/tmp/' + filename)
return defer.succeed(None)
def tearDown(self, *args, **kwargs):
"""Clean the reactor"""
helpers.SatTestCase.tearDown(self, *args, **kwargs)