mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Trying new syncmail, added Cmd class.
This commit is contained in:
parent
3620be1ed2
commit
0aa5ece16a
25
test/test.py
25
test/test.py
@ -75,6 +75,31 @@ nicks += [msg.nick for msg in msgs if msg.nick]
|
||||
def getMsgs(command):
|
||||
return [msg for msg in msgs if msg.command == command]
|
||||
|
||||
class Cmd(object):
|
||||
def __init__(self, command, *args):
|
||||
self.args = (command,) + args
|
||||
|
||||
def toString(self, recursed=False):
|
||||
if recursed:
|
||||
return '[%s]' % ' '.join(map(utils.dqrepr, args))
|
||||
else:
|
||||
L = [conf.prefixChars[0]]
|
||||
for arg in args:
|
||||
if isinstance(arg, self.__class__):
|
||||
L.append(utils.dqrepr(arg.toString(recursed=True)))
|
||||
else:
|
||||
L.append(utils.dqrepr(arg))
|
||||
L.append(' ')
|
||||
L.pop()
|
||||
return ''.join(L)
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
class PluginTestCase(unittest.TestCase):
|
||||
callbacks = ()
|
||||
channels = ()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
world.testing = True
|
||||
|
Loading…
Reference in New Issue
Block a user