mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-27 05:21:09 -05:00
Fixed the failing testAddressedReplyWhenNotAddressed test.
This commit is contained in:
parent
28062699b8
commit
e2795d3ef0
@ -48,6 +48,7 @@ supybot.log.stdout: False
|
|||||||
supybot.log.level: DEBUG
|
supybot.log.level: DEBUG
|
||||||
supybot.log.detailedTracebacks: False
|
supybot.log.detailedTracebacks: False
|
||||||
supybot.throttleTime: 0
|
supybot.throttleTime: 0
|
||||||
|
supybot.prefixChars: @
|
||||||
""")
|
""")
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
@ -57,6 +58,7 @@ registry.open(registryFilename)
|
|||||||
import log
|
import log
|
||||||
import conf
|
import conf
|
||||||
conf.allowEval = True
|
conf.allowEval = True
|
||||||
|
conf.supybot.flush.setValue(False)
|
||||||
|
|
||||||
import fix
|
import fix
|
||||||
|
|
||||||
@ -123,6 +125,11 @@ if __name__ == '__main__':
|
|||||||
args = map(path, glob.glob(os.path.join('test', pattern)))
|
args = map(path, glob.glob(os.path.join('test', pattern)))
|
||||||
|
|
||||||
if options.exclusions:
|
if options.exclusions:
|
||||||
|
for (i, s) in enumerate(options.exclusions):
|
||||||
|
if not s.startswith('test/') and not s.startswith('test\\'):
|
||||||
|
s = 'test/' + s
|
||||||
|
if not s.endswith('.py'):
|
||||||
|
s += '.py'
|
||||||
for name in map(path, options.exclusions):
|
for name in map(path, options.exclusions):
|
||||||
args = [s for s in args if s != name]
|
args = [s for s in args if s != name]
|
||||||
|
|
||||||
|
@ -154,13 +154,14 @@ class FunctionsTestCase(unittest.TestCase):
|
|||||||
msg1 = ircmsgs.privmsg('#foo', '@bar')
|
msg1 = ircmsgs.privmsg('#foo', '@bar')
|
||||||
msg2 = ircmsgs.privmsg('#foo', 'bar')
|
msg2 = ircmsgs.privmsg('#foo', 'bar')
|
||||||
self.assertEqual(callbacks.addressed('blah', msg1), 'bar')
|
self.assertEqual(callbacks.addressed('blah', msg1), 'bar')
|
||||||
|
self.assertEqual(callbacks.addressed('blah', msg2), '')
|
||||||
try:
|
try:
|
||||||
original = str(conf.supybot.reply.whenNotAddressed)
|
original = conf.supybot.reply.whenNotAddressed()
|
||||||
conf.supybot.reply.whenNotAddressed.set('True')
|
conf.supybot.reply.whenNotAddressed.setValue(True)
|
||||||
self.assertEqual(callbacks.addressed('blah', msg1), 'bar')
|
self.assertEqual(callbacks.addressed('blah', msg1), 'bar')
|
||||||
self.assertEqual(callbacks.addressed('blah', msg2), 'bar')
|
self.assertEqual(callbacks.addressed('blah', msg2), 'bar')
|
||||||
finally:
|
finally:
|
||||||
conf.supybot.reply.whenNotAddressed.set(original)
|
conf.supybot.reply.whenNotAddressed.setValue(original)
|
||||||
|
|
||||||
def testReply(self):
|
def testReply(self):
|
||||||
prefix = 'foo!bar@baz'
|
prefix = 'foo!bar@baz'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user