mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fixed bugs in these tests.
This commit is contained in:
parent
ec0dd27960
commit
1f0e646ff3
@ -36,12 +36,20 @@ import conf
|
|||||||
class AdminTestCase(PluginTestCase, PluginDocumentation):
|
class AdminTestCase(PluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Admin',)
|
plugins = ('Admin',)
|
||||||
def testChannels(self):
|
def testChannels(self):
|
||||||
|
def getAfterJoinMessages():
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.assertEqual(m.command, 'MODE')
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.assertEqual(m.command, 'WHO')
|
||||||
self.assertRegexp('channels', 'not.*in any')
|
self.assertRegexp('channels', 'not.*in any')
|
||||||
self.irc.feedMsg(ircmsgs.join('#foo', prefix=self.prefix))
|
self.irc.feedMsg(ircmsgs.join('#foo', prefix=self.prefix))
|
||||||
|
getAfterJoinMessages()
|
||||||
self.assertRegexp('channels', '#foo')
|
self.assertRegexp('channels', '#foo')
|
||||||
self.irc.feedMsg(ircmsgs.join('#bar', prefix=self.prefix))
|
self.irc.feedMsg(ircmsgs.join('#bar', prefix=self.prefix))
|
||||||
|
getAfterJoinMessages()
|
||||||
self.assertRegexp('channels', '#bar and #foo')
|
self.assertRegexp('channels', '#bar and #foo')
|
||||||
self.irc.feedMsg(ircmsgs.join('#Baz', prefix=self.prefix))
|
self.irc.feedMsg(ircmsgs.join('#Baz', prefix=self.prefix))
|
||||||
|
getAfterJoinMessages()
|
||||||
self.assertRegexp('channels', '#bar, #Baz, and #foo')
|
self.assertRegexp('channels', '#bar, #Baz, and #foo')
|
||||||
|
|
||||||
def testIgnoreUnignore(self):
|
def testIgnoreUnignore(self):
|
||||||
@ -100,18 +108,23 @@ class AdminTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
self.assertEqual(m.args[1], 'key2,key1')
|
self.assertEqual(m.args[1], 'key2,key1')
|
||||||
|
|
||||||
def testPart(self):
|
def testPart(self):
|
||||||
|
def getAfterJoinMessages():
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.assertEqual(m.command, 'MODE')
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.assertEqual(m.command, 'WHO')
|
||||||
self.assertError('part #foo')
|
self.assertError('part #foo')
|
||||||
self.assertRegexp('part #foo', 'currently')
|
self.assertRegexp('part #foo', 'currently')
|
||||||
_ = self.getMsg('join #foo') # get the JOIN.
|
self.irc.feedMsg(ircmsgs.join('#foo', prefix=self.prefix))
|
||||||
_ = self.getMsg(' ') # get the WHO.
|
getAfterJoinMessages()
|
||||||
self.assertError('part #foo #bar')
|
self.assertError('part #foo #bar')
|
||||||
m = self.getMsg('part #foo')
|
m = self.getMsg('part #foo')
|
||||||
self.assertEqual(m.command, 'PART')
|
self.assertEqual(m.command, 'PART')
|
||||||
self.assertEqual(m.args[0], '#foo')
|
self.assertEqual(m.args[0], '#foo')
|
||||||
_ = self.getMsg('join #foo #bar') # get the JOIN.
|
self.irc.feedMsg(ircmsgs.join('#foo', prefix=self.prefix))
|
||||||
_ = self.getMsg(' ') # get the WHO.
|
getAfterJoinMessages()
|
||||||
# vvv(won't send this because there was no server response.)
|
self.irc.feedMsg(ircmsgs.join('#bar', prefix=self.prefix))
|
||||||
# _ = self.getMsg(' ') # get the WH0.
|
getAfterJoinMessages()
|
||||||
m = self.getMsg('part #foo #bar')
|
m = self.getMsg('part #foo #bar')
|
||||||
self.assertEqual(m.command, 'PART')
|
self.assertEqual(m.command, 'PART')
|
||||||
self.assertEqual(m.args[0], '#foo,#bar')
|
self.assertEqual(m.args[0], '#foo,#bar')
|
||||||
|
Loading…
Reference in New Issue
Block a user