diff --git a/test/test.py b/test/test.py index 47b500d02..77ef79714 100644 --- a/test/test.py +++ b/test/test.py @@ -36,7 +36,11 @@ load = unittest.defaultTestLoader.loadTestsFromModule GLOBALS = globals() dirname = os.path.dirname(__file__) -for filename in os.listdir(dirname): +filenames = os.listdir(dirname) +# Uncomment these if you need some consistency in the order these tests run. +# filenames.sort() +# filenames.reverse() +for filename in filenames: if filename.startswith('test_') and filename.endswith('.py'): name = filename[:-3] exec 'import %s' % name in GLOBALS diff --git a/test/test_irclib.py b/test/test_irclib.py index 391cb05be..7c5fb8e68 100644 --- a/test/test_irclib.py +++ b/test/test_irclib.py @@ -368,8 +368,12 @@ class IrcStateTestCase(SupyTestCase): class IrcTestCase(SupyTestCase): def setUp(self): self.irc = irclib.Irc('test') - _ = self.irc.takeMsg() # NICK - _ = self.irc.takeMsg() # USER + #m = self.irc.takeMsg() + #self.failUnless(m.command == 'PASS', 'Expected PASS, got %r.' % m) + m = self.irc.takeMsg() + self.failUnless(m.command == 'NICK', 'Expected NICK, got %r.' % m) + m = self.irc.takeMsg() + self.failUnless(m.command == 'USER', 'Expected USER, got %r.' % m) def testPingResponse(self): self.irc.feedMsg(ircmsgs.ping('123')) @@ -482,10 +486,9 @@ class IrcCallbackTestCase(SupyTestCase): expected.insert(0, ircmsgs.password(password)) self.assertEqual(msgs, expected) finally: - conf.supybot.nick.setValue(nick) - conf.supybot.user.setValue(user) - conf.supybot.networks.test.password.setValue(password) - conf.supybot.nick.setValue(nick) + conf.supybot.nick.setValue(originalNick) + conf.supybot.user.setValue(originalUser) + conf.supybot.networks.test.password.setValue(originalPassword) # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: