mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 09:29:24 +01:00
plugins/Time: Make sure the Time commands are nested-safe, i.e. they reply with strings.
This commit is contained in:
parent
ff2eb7daa9
commit
aeaad9056c
@ -112,7 +112,7 @@ class Time(callbacks.Plugin):
|
|||||||
if new != now:
|
if new != now:
|
||||||
if new - now < 0:
|
if new - now < 0:
|
||||||
new += 86400
|
new += 86400
|
||||||
irc.reply(new-now)
|
irc.reply(str(new-now))
|
||||||
else:
|
else:
|
||||||
irc.error('That\'s right now!')
|
irc.error('That\'s right now!')
|
||||||
until = wrap(until, ['text'])
|
until = wrap(until, ['text'])
|
||||||
|
@ -51,6 +51,11 @@ class TimeTestCase(PluginTestCase):
|
|||||||
self.assertNotError('ctime')
|
self.assertNotError('ctime')
|
||||||
self.assertNotError('time %Y')
|
self.assertNotError('time %Y')
|
||||||
|
|
||||||
|
def testNoNestedErrors(self):
|
||||||
|
self.assertNotError('echo [until 4:00]')
|
||||||
|
self.assertNotError('echo [at now]')
|
||||||
|
self.assertNotError('echo [seconds 4m]')
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user