summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-09-09 00:02:23 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-09-12 17:29:38 +0100
commitcea29eb55ece9c94e608c7b46505e12c2ee08fd5 (patch)
tree88e69817c1dd3a8ed54c1231fb46ee077c1cd88c /tests
parent8b44ba9f8d095ea273f4c30cd5a868b22f53c2c3 (diff)
tests: strip \r\n from stream event data
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/channels/requests-muc.py5
-rw-r--r--tests/twisted/connect/server-quit-noclose.py2
-rw-r--r--tests/twisted/idletest.py4
-rw-r--r--tests/twisted/messages/message-order.py2
4 files changed, 7 insertions, 6 deletions
diff --git a/tests/twisted/channels/requests-muc.py b/tests/twisted/channels/requests-muc.py
index 5aec1b3..4e37c49 100644
--- a/tests/twisted/channels/requests-muc.py
+++ b/tests/twisted/channels/requests-muc.py
@@ -99,9 +99,8 @@ def test(q, bus, conn, stream):
# This is a regression test for
# <https://bugs.freedesktop.org/show_bug.cgi?id=34812>, where part messages
- # were not correctly colon-quoted. rstrip seems to be needed to get rid of
- # the \r\n...
- assertEquals("bye bye cruel world", part_event.data[1].rstrip())
+ # were not correctly colon-quoted.
+ assertEquals("bye bye cruel world", part_event.data[1])
stream.sendPart('#idletest', stream.nick)
diff --git a/tests/twisted/connect/server-quit-noclose.py b/tests/twisted/connect/server-quit-noclose.py
index bf0a5cf..fabb23f 100644
--- a/tests/twisted/connect/server-quit-noclose.py
+++ b/tests/twisted/connect/server-quit-noclose.py
@@ -10,7 +10,7 @@ from twisted.internet import reactor, ssl
class QuitNoCloseServer(BaseIRCServer):
def handleQUIT(self, args, prefix):
- quit_msg = ' '.join(args).rstrip('\r\n')
+ quit_msg = ' '.join(args)
self.sendMessage('ERROR', ':Closing Link: idle.test.server (Quit: %s)' % quit_msg)
# don't call self.transport.loseConnection()
diff --git a/tests/twisted/idletest.py b/tests/twisted/idletest.py
index 9136cbc..63e0af3 100644
--- a/tests/twisted/idletest.py
+++ b/tests/twisted/idletest.py
@@ -12,6 +12,8 @@ from twisted.words.protocols import irc
from twisted.internet import reactor, ssl
def make_irc_event(type, data):
+ if data is not None:
+ data[-1] = data[-1].rstrip('\r\n')
event = servicetest.Event(type, data=data)
return event
@@ -125,7 +127,7 @@ class BaseIRCServer(irc.IRC):
self.sendMessage('366', self.nick, room, ':End of /NAMES list', prefix='idle.test.server')
def handleQUIT(self, args, prefix):
- quit_msg = ' '.join(args).rstrip('\r\n')
+ quit_msg = ' '.join(args)
self.sendMessage('ERROR', ':Closing Link: idle.test.server (Quit: %s)' % quit_msg)
self.transport.loseConnection()
diff --git a/tests/twisted/messages/message-order.py b/tests/twisted/messages/message-order.py
index 2d07bda..0f2876a 100644
--- a/tests/twisted/messages/message-order.py
+++ b/tests/twisted/messages/message-order.py
@@ -33,7 +33,7 @@ def test(q, bus, conn, stream):
for i in range(NUM_MESSAGES):
message = q.expect('stream-PRIVMSG')
assert message.data[0] == CHANNEL_NAME
- assert message.data[1].rstrip('\r\n') == str(i)
+ assert message.data[1] == str(i)
call_async(q, conn, 'Disconnect')
return True