mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Fixed test failures caused after test_irclib.py runs, and added a couple extra asserts and some commented out lines for more predictable test order.
This commit is contained in:
parent
cf760c0401
commit
06feea3ae7
@ -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
|
||||
|
@ -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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user