diff --git a/plugins/Seen/plugin.py b/plugins/Seen/plugin.py index b487334dc..fbf38fc11 100644 --- a/plugins/Seen/plugin.py +++ b/plugins/Seen/plugin.py @@ -130,9 +130,10 @@ class Seen(callbacks.Plugin): self.ircstates[irc] = irclib.IrcState() if irc not in self.lastmsg: self.lastmsg[irc] = ircmsgs.ping('this is just a fake message') - for channel in irc.state.channels: - irc.queueMsg(ircmsgs.who(channel)) - irc.queueMsg(ircmsgs.names(channel)) + if not world.testing: + for channel in irc.state.channels: + irc.queueMsg(ircmsgs.who(channel)) + irc.queueMsg(ircmsgs.names(channel)) def doPrivmsg(self, irc, msg): if irc.isChannel(msg.args[0]): diff --git a/plugins/Seen/test.py b/plugins/Seen/test.py index 4795c638d..df020bb7a 100644 --- a/plugins/Seen/test.py +++ b/plugins/Seen/test.py @@ -50,13 +50,9 @@ class ChannelDBTestCase(ChannelPluginTestCase): self.assertNotRegexp('seen asldfkjasdlfkj', 'KeyError') def testAny(self): - self.irc.feedMsg(ircmsgs.join(self.channel, 'baz!foo@bar')) - self.assertRegexp('seen any', 'baz has joined') - self.irc.feedMsg(ircmsgs.part(self.channel, 'baz!foo@bar')) - self.assertRegexp('seen any', 'baz has parted') - self.irc.feedMsg(ircmsgs.mode(self.channel, args=('+o', 'baz'), - prefix='baz!foo@bar')) - self.assertRegexp('seen any baz', 'baz sets mode') + self.assertRegexp('seen any', 'test has joined') + self.irc.feedMsg(ircmsgs.mode(self.channel, args=('+o', self.nick), + prefix=self.prefix)) self.assertRegexp('seen any %s' % self.nick, '^%s was last seen' % self.nick)