Replace deprecated unittest function calls.

This commit is contained in:
Valentin Lorentz 2021-11-08 21:10:51 +01:00
parent 93c63092d9
commit ce7e4b754c
2 changed files with 8 additions and 8 deletions

View File

@ -71,7 +71,7 @@ class AdminTestCase(PluginTestCase):
ircdb.users.setUser(u) ircdb.users.setUser(u)
self.assertNotError('capability add foo bar') self.assertNotError('capability add foo bar')
self.assertError('addcapability foo baz') self.assertError('addcapability foo baz')
self.assert_('bar' in u.capabilities) self.assertIn('bar', u.capabilities)
ircdb.users.delUser(u.id) ircdb.users.delUser(u.id)
def testCapabilityRemove(self): def testCapabilityRemove(self):
@ -80,10 +80,10 @@ class AdminTestCase(PluginTestCase):
u.name = 'foo' u.name = 'foo'
ircdb.users.setUser(u) ircdb.users.setUser(u)
self.assertNotError('capability add foo bar') self.assertNotError('capability add foo bar')
self.assert_('bar' in u.capabilities) self.assertIn('bar', u.capabilities)
self.assertError('removecapability foo bar') self.assertError('removecapability foo bar')
self.assertNotError('capability remove 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) ircdb.users.delUser(u.id)
def testJoin(self): def testJoin(self):

View File

@ -528,7 +528,7 @@ class IrcStateTestCase(SupyTestCase):
def testDoModeOnlyChannels(self): def testDoModeOnlyChannels(self):
st = irclib.IrcState() 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): def testNamreply(self):
"""RPL_NAMREPLY / reply to NAMES""" """RPL_NAMREPLY / reply to NAMES"""
@ -740,14 +740,14 @@ class StsTestCase(SupyTestCase):
self.irc = irclib.Irc('test') self.irc = irclib.Irc('test')
m = self.irc.takeMsg() m = self.irc.takeMsg()
self.failUnless(m.command == 'CAP', 'Expected CAP, got %r.' % m) self.assertEqual(m.command, 'CAP', 'Expected CAP, got %r.' % m)
self.failUnless(m.args == ('LS', '302'), 'Expected CAP LS 302, got %r.' % m) self.assertEqual(m.args, ('LS', '302'), 'Expected CAP LS 302, got %r.' % m)
m = self.irc.takeMsg() 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() 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() self.irc.driver = unittest.mock.Mock()