summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDebarshi Ray <rishi@gnu.org>2011-09-29 07:51:51 +0300
committerDebarshi Ray <rishi@gnu.org>2011-10-04 15:59:47 +0300
commit0eb472e4248690e964ea49ae1b4c73a83d9b44bd (patch)
tree6a64608cf77126b49f04fab16a1dc9d05801503c /tests
parent1f25c9c24d37634dcb2ea1ac4f51d6557814f014 (diff)
downloadtelepathy-idle-0eb472e4248690e964ea49ae1b4c73a83d9b44bd.tar.gz
idletest: Use handleCommand instead of dataReceived
Unlike dataReceived, handleCommand splits the data if it has multiple messages and parses each message.
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/idletest.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/twisted/idletest.py b/tests/twisted/idletest.py
index 71e6d8e..5288a37 100644
--- a/tests/twisted/idletest.py
+++ b/tests/twisted/idletest.py
@@ -134,17 +134,16 @@ class BaseIRCServer(irc.IRC):
def sendWelcome(self):
self.sendMessage('001', self.nick, ':Welcome to the test IRC Network', prefix='idle.test.server')
- def dataReceived(self, data):
- (_prefix, _command, _args) = irc.parsemsg(data)
- self.event_func(make_irc_event('stream-%s' % _command, _args))
+ def handleCommand(self, command, prefix, params):
+ self.event_func(make_irc_event('stream-%s' % command, params))
try:
- f = getattr(self, 'handle%s' % _command)
+ f = getattr(self, 'handle%s' % command)
try:
- f(_args, _prefix)
+ f(params, prefix)
except Exception, e:
self.log('handler failed: %s' % e)
except Exception, e:
- self.log('No handler for command %s: %s' % (_command, e))
+ self.log('No handler for command %s: %s' % (command, e))
class SSLIRCServer(BaseIRCServer):
def __init__(self, event_func):