mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
src/test.py: Fix encoding issues with assertResponse being given an utf8 string.
This commit is contained in:
parent
97a977a1eb
commit
f63148849c
@ -227,6 +227,8 @@ class PluginTestCase(SupyTestCase):
|
||||
prefixChars = conf.supybot.reply.whenAddressedBy.chars()
|
||||
if not usePrefixChar and query[0] in prefixChars:
|
||||
query = query[1:]
|
||||
if sys.version_info[0] < 3:
|
||||
query = query.encode('utf8', errors='replace') # unicode->str
|
||||
msg = ircmsgs.privmsg(to, query, prefix=frm)
|
||||
if self.myVerbose:
|
||||
print 'Feeding: %r' % msg
|
||||
@ -417,6 +419,8 @@ class ChannelPluginTestCase(PluginTestCase):
|
||||
prefixChars = conf.supybot.reply.whenAddressedBy.chars()
|
||||
if query[0] not in prefixChars and usePrefixChar:
|
||||
query = prefixChars[0] + query
|
||||
if sys.version_info[0] < 3:
|
||||
query = query.encode('utf8', errors='replace') # unicode->str
|
||||
msg = ircmsgs.privmsg(to, query, prefix=frm)
|
||||
if self.myVerbose:
|
||||
print 'Feeding: %r' % msg
|
||||
|
Loading…
Reference in New Issue
Block a user