mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
Channel: Make use of the context() method of registry.Value objects.
This commit is contained in:
parent
4e8c35dd0c
commit
3063340ce3
@ -204,14 +204,11 @@ class ChannelTestCase(ChannelPluginTestCase):
|
|||||||
## self.assertError('kban %s' % self.irc.nick)
|
## self.assertError('kban %s' % self.irc.nick)
|
||||||
|
|
||||||
def testBan(self):
|
def testBan(self):
|
||||||
origban = conf.supybot.protocols.irc.banmask()
|
with conf.supybot.protocols.irc.banmask.context(['exact']):
|
||||||
try:
|
|
||||||
conf.supybot.protocols.irc.banmask.setValue(['exact'])
|
|
||||||
self.assertNotError('ban add foo!bar@baz')
|
self.assertNotError('ban add foo!bar@baz')
|
||||||
self.assertNotError('ban remove foo!bar@baz')
|
self.assertNotError('ban remove foo!bar@baz')
|
||||||
orig = conf.supybot.protocols.irc.strictRfc()
|
orig = conf.supybot.protocols.irc.strictRfc()
|
||||||
try:
|
with conf.supybot.protocols.irc.strictRfc.context(True):
|
||||||
conf.supybot.protocols.irc.strictRfc.setValue(True)
|
|
||||||
# something wonky is going on here. irc.error (src/Channel.py|449)
|
# something wonky is going on here. irc.error (src/Channel.py|449)
|
||||||
# is being called but the assert is failing
|
# is being called but the assert is failing
|
||||||
self.assertError('ban add not!a.hostmask')
|
self.assertError('ban add not!a.hostmask')
|
||||||
@ -221,10 +218,6 @@ class ChannelTestCase(ChannelPluginTestCase):
|
|||||||
conf.supybot.protocols.irc.strictRfc.setValue(False)
|
conf.supybot.protocols.irc.strictRfc.setValue(False)
|
||||||
self.assertNotError('ban add $a:nyuszika7h')
|
self.assertNotError('ban add $a:nyuszika7h')
|
||||||
self.assertNotError('ban remove $a:nyuszika7h')
|
self.assertNotError('ban remove $a:nyuszika7h')
|
||||||
finally:
|
|
||||||
conf.supybot.protocols.irc.strictRfc.setValue(orig)
|
|
||||||
finally:
|
|
||||||
conf.supybot.protocols.irc.banmask.setValue(origban)
|
|
||||||
|
|
||||||
def testIgnore(self):
|
def testIgnore(self):
|
||||||
orig = conf.supybot.protocols.irc.banmask()
|
orig = conf.supybot.protocols.irc.banmask()
|
||||||
@ -235,15 +228,12 @@ class ChannelTestCase(ChannelPluginTestCase):
|
|||||||
self.assertResponse('channel ignore list', "'%s'" % expect)
|
self.assertResponse('channel ignore list', "'%s'" % expect)
|
||||||
self.assertNotError('channel ignore remove %s' % expect)
|
self.assertNotError('channel ignore remove %s' % expect)
|
||||||
self.assertRegexp('channel ignore list', 'not currently')
|
self.assertRegexp('channel ignore list', 'not currently')
|
||||||
try:
|
ignore('foo!bar@baz', '*!bar@baz')
|
||||||
ignore('foo!bar@baz', '*!bar@baz')
|
ignore('foo!*@*')
|
||||||
ignore('foo!*@*')
|
with conf.supybot.protocols.irc.banmask.context(['exact']):
|
||||||
conf.supybot.protocols.irc.banmask.setValue(['exact'])
|
|
||||||
ignore('foo!bar@baz')
|
ignore('foo!bar@baz')
|
||||||
ignore('foo!*@*')
|
ignore('foo!*@*')
|
||||||
self.assertError('ban add not!a.hostmask')
|
self.assertError('ban add not!a.hostmask')
|
||||||
finally:
|
|
||||||
conf.supybot.protocols.irc.banmask.setValue(orig)
|
|
||||||
|
|
||||||
def testNicks(self):
|
def testNicks(self):
|
||||||
self.assertResponse('channel nicks', 'bar, foo, and test')
|
self.assertResponse('channel nicks', 'bar, foo, and test')
|
||||||
|
Loading…
Reference in New Issue
Block a user