Fixed the failing testAddressedReplyWhenNotAddressed test.

This commit is contained in:
Jeremy Fincher 2004-02-13 08:53:19 +00:00
parent 28062699b8
commit e2795d3ef0
2 changed files with 11 additions and 3 deletions

View File

@ -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]

View File

@ -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'