mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-25 20:41:18 -05:00
Add test the bot won't account-extban itself
This commit is contained in:
parent
917e3019bc
commit
be3dae3558
@ -189,6 +189,30 @@ class ChannelTestCase(ChannelPluginTestCase):
|
|||||||
self.assertBan('iban $a:nyuszika7h', '$a:nyuszika7h')
|
self.assertBan('iban $a:nyuszika7h', '$a:nyuszika7h')
|
||||||
self.assertNotError('unban $a:nyuszika7h')
|
self.assertNotError('unban $a:nyuszika7h')
|
||||||
|
|
||||||
|
def testWontIbanItself(self):
|
||||||
|
self.irc.state.supported['ACCOUNTEXTBAN'] = 'a,account'
|
||||||
|
self.irc.state.supported['EXTBAN'] = '~,abc'
|
||||||
|
|
||||||
|
self.irc.feedMsg(ircmsgs.join(self.channel,
|
||||||
|
prefix='foobar!user@host.domain.tld'))
|
||||||
|
self.irc.feedMsg(ircmsgs.op(self.channel, self.irc.nick))
|
||||||
|
|
||||||
|
# not authenticated, falls back to hostname and notices the match
|
||||||
|
self.assertError('iban --account ' + self.nick)
|
||||||
|
|
||||||
|
self.irc.feedMsg(ircmsgs.IrcMsg(prefix=self.prefix, command='ACCOUNT',
|
||||||
|
args=['botaccount']))
|
||||||
|
|
||||||
|
# notices the matching account
|
||||||
|
self.assertError('iban --account ' + self.nick)
|
||||||
|
|
||||||
|
self.irc.feedMsg(ircmsgs.IrcMsg(prefix='othernick!otheruser@otherhost',
|
||||||
|
command='ACCOUNT',
|
||||||
|
args=['botaccount']))
|
||||||
|
|
||||||
|
# ditto
|
||||||
|
self.assertError('iban --account othernick')
|
||||||
|
|
||||||
def testKban(self):
|
def testKban(self):
|
||||||
self.irc.prefix = 'something!else@somehwere.else'
|
self.irc.prefix = 'something!else@somehwere.else'
|
||||||
self.irc.nick = 'something'
|
self.irc.nick = 'something'
|
||||||
|
@ -318,7 +318,8 @@ class PluginTestCase(SupyTestCase):
|
|||||||
raise TimeoutError(query)
|
raise TimeoutError(query)
|
||||||
if lastGetHelp not in m.args[1]:
|
if lastGetHelp not in m.args[1]:
|
||||||
self.assertTrue(m.args[1].startswith('Error:'),
|
self.assertTrue(m.args[1].startswith('Error:'),
|
||||||
'%r did not error: %s' % (query, m.args[1]))
|
'%r did not error: %s' %
|
||||||
|
(query, ' '.join(m.args[1:])))
|
||||||
return m
|
return m
|
||||||
|
|
||||||
def assertSnarfError(self, query, **kwargs):
|
def assertSnarfError(self, query, **kwargs):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user