mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01: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.detailedTracebacks: False
|
||||
supybot.throttleTime: 0
|
||||
supybot.prefixChars: @
|
||||
""")
|
||||
fd.close()
|
||||
|
||||
@ -57,6 +58,7 @@ registry.open(registryFilename)
|
||||
import log
|
||||
import conf
|
||||
conf.allowEval = True
|
||||
conf.supybot.flush.setValue(False)
|
||||
|
||||
import fix
|
||||
|
||||
@ -123,6 +125,11 @@ if __name__ == '__main__':
|
||||
args = map(path, glob.glob(os.path.join('test', pattern)))
|
||||
|
||||
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):
|
||||
args = [s for s in args if s != name]
|
||||
|
||||
|
@ -154,13 +154,14 @@ class FunctionsTestCase(unittest.TestCase):
|
||||
msg1 = ircmsgs.privmsg('#foo', '@bar')
|
||||
msg2 = ircmsgs.privmsg('#foo', 'bar')
|
||||
self.assertEqual(callbacks.addressed('blah', msg1), 'bar')
|
||||
self.assertEqual(callbacks.addressed('blah', msg2), '')
|
||||
try:
|
||||
original = str(conf.supybot.reply.whenNotAddressed)
|
||||
conf.supybot.reply.whenNotAddressed.set('True')
|
||||
original = conf.supybot.reply.whenNotAddressed()
|
||||
conf.supybot.reply.whenNotAddressed.setValue(True)
|
||||
self.assertEqual(callbacks.addressed('blah', msg1), 'bar')
|
||||
self.assertEqual(callbacks.addressed('blah', msg2), 'bar')
|
||||
finally:
|
||||
conf.supybot.reply.whenNotAddressed.set(original)
|
||||
conf.supybot.reply.whenNotAddressed.setValue(original)
|
||||
|
||||
def testReply(self):
|
||||
prefix = 'foo!bar@baz'
|
||||
|
Loading…
Reference in New Issue
Block a user