mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-14 14:49:21 +01:00
Replace deprecated unittest function calls.
This commit is contained in:
parent
93c63092d9
commit
ce7e4b754c
@ -71,7 +71,7 @@ class AdminTestCase(PluginTestCase):
|
||||
ircdb.users.setUser(u)
|
||||
self.assertNotError('capability add foo bar')
|
||||
self.assertError('addcapability foo baz')
|
||||
self.assert_('bar' in u.capabilities)
|
||||
self.assertIn('bar', u.capabilities)
|
||||
ircdb.users.delUser(u.id)
|
||||
|
||||
def testCapabilityRemove(self):
|
||||
@ -80,10 +80,10 @@ class AdminTestCase(PluginTestCase):
|
||||
u.name = 'foo'
|
||||
ircdb.users.setUser(u)
|
||||
self.assertNotError('capability add foo bar')
|
||||
self.assert_('bar' in u.capabilities)
|
||||
self.assertIn('bar', u.capabilities)
|
||||
self.assertError('removecapability foo bar')
|
||||
self.assertNotError('capability remove foo bar')
|
||||
self.assert_(not 'bar' in u.capabilities)
|
||||
self.assertNotIn('bar', u.capabilities)
|
||||
ircdb.users.delUser(u.id)
|
||||
|
||||
def testJoin(self):
|
||||
|
@ -528,7 +528,7 @@ class IrcStateTestCase(SupyTestCase):
|
||||
|
||||
def testDoModeOnlyChannels(self):
|
||||
st = irclib.IrcState()
|
||||
self.assert_(st.addMsg(self.irc, ircmsgs.IrcMsg('MODE foo +i')) or 1)
|
||||
self.assertTrue(st.addMsg(self.irc, ircmsgs.IrcMsg('MODE foo +i')) or 1)
|
||||
|
||||
def testNamreply(self):
|
||||
"""RPL_NAMREPLY / reply to NAMES"""
|
||||
@ -740,14 +740,14 @@ class StsTestCase(SupyTestCase):
|
||||
self.irc = irclib.Irc('test')
|
||||
|
||||
m = self.irc.takeMsg()
|
||||
self.failUnless(m.command == 'CAP', 'Expected CAP, got %r.' % m)
|
||||
self.failUnless(m.args == ('LS', '302'), 'Expected CAP LS 302, got %r.' % m)
|
||||
self.assertEqual(m.command, 'CAP', 'Expected CAP, got %r.' % m)
|
||||
self.assertEqual(m.args, ('LS', '302'), 'Expected CAP LS 302, got %r.' % m)
|
||||
|
||||
m = self.irc.takeMsg()
|
||||
self.failUnless(m.command == 'NICK', 'Expected NICK, got %r.' % m)
|
||||
self.assertEqual(m.command, 'NICK', 'Expected NICK, got %r.' % m)
|
||||
|
||||
m = self.irc.takeMsg()
|
||||
self.failUnless(m.command == 'USER', 'Expected USER, got %r.' % m)
|
||||
self.assertEqual(m.command, 'USER', 'Expected USER, got %r.' % m)
|
||||
|
||||
self.irc.driver = unittest.mock.Mock()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user