mirror of https://github.com/Mikaela/Limnoria.git
Fixed bug in default argument for IrcMsg.__init__ -- args should default to (), not None.
This commit is contained in:
parent
b6185c4b33
commit
ee24accaf7
|
@ -80,7 +80,7 @@ class IrcMsg(object):
|
||||||
"""
|
"""
|
||||||
__slots__ = ('args', 'command', 'host', 'nick', 'prefix', 'user',
|
__slots__ = ('args', 'command', 'host', 'nick', 'prefix', 'user',
|
||||||
'_hash', '_str', '_repr', '_len')
|
'_hash', '_str', '_repr', '_len')
|
||||||
def __init__(self, s='', command='', args=None, prefix='', msg=None):
|
def __init__(self, s='', command='', args=(), prefix='', msg=None):
|
||||||
assert not (msg and s), 'Ircmsg.__init__ cannot accept both s and msg'
|
assert not (msg and s), 'Ircmsg.__init__ cannot accept both s and msg'
|
||||||
if not s and not command and not msg:
|
if not s and not command and not msg:
|
||||||
raise MalformedIrcMsg, 'IRC messages require a command.'
|
raise MalformedIrcMsg, 'IRC messages require a command.'
|
||||||
|
|
|
@ -180,5 +180,8 @@ class FunctionsTestCase(unittest.TestCase):
|
||||||
self.assertEqual(ircmsgs.joins(channels, keys).args,
|
self.assertEqual(ircmsgs.joins(channels, keys).args,
|
||||||
('#osu,#umich', 'michiganSucks'))
|
('#osu,#umich', 'michiganSucks'))
|
||||||
|
|
||||||
|
def testQuit(self):
|
||||||
|
self.failUnless(ircmsgs.quit(prefix='foo!bar@baz'))
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
|
Loading…
Reference in New Issue