mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Changed irclib.Channel to irclib.ChannelState.
This commit is contained in:
parent
2ea1052d06
commit
3891360527
@ -152,7 +152,7 @@ class IrcMsgQueue(object):
|
||||
# Maintains the state of IRC connection -- the most recent messages, the
|
||||
# status of various modes (especially ops/halfops/voices) in channels, etc.
|
||||
###
|
||||
class Channel(object):
|
||||
class ChannelState(object):
|
||||
__slots__ = ('users', 'ops', 'halfops', 'voices', 'topic')
|
||||
def __init__(self):
|
||||
self.topic = ''
|
||||
@ -265,7 +265,7 @@ class IrcState(IrcCommandDispatcher):
|
||||
if channel in self.channels:
|
||||
self.channels[channel].addUser(msg.nick)
|
||||
else:
|
||||
chan = Channel()
|
||||
chan = ChannelState()
|
||||
chan.addUser(msg.nick)
|
||||
self.channels[channel] = chan
|
||||
|
||||
|
@ -116,14 +116,14 @@ class IrcMsgQueueTestCase(unittest.TestCase):
|
||||
self.assertEqual(self.msg, q.dequeue())
|
||||
|
||||
|
||||
class ChannelTestCase(unittest.TestCase):
|
||||
class ChannelStateTestCase(unittest.TestCase):
|
||||
def testPickleCopy(self):
|
||||
c = irclib.Channel()
|
||||
c = irclib.ChannelState()
|
||||
c1 = pickle.loads(pickle.dumps(c))
|
||||
self.assertEqual(pickle.loads(pickle.dumps(c)), c)
|
||||
|
||||
def testAddUser(self):
|
||||
c = irclib.Channel()
|
||||
c = irclib.ChannelState()
|
||||
c.addUser('foo')
|
||||
self.failUnless('foo' in c.users)
|
||||
self.failIf('foo' in c.ops)
|
||||
@ -214,7 +214,7 @@ class IrcStateTestCase(unittest.TestCase):
|
||||
|
||||
def testDoModeOnlyChannels(self):
|
||||
st = irclib.IrcState()
|
||||
st.addMsg(self.irc, ircmsgs.IrcMsg('MODE foo +i'))
|
||||
self.assert_(st.addMsg(self.irc, ircmsgs.IrcMsg('MODE foo +i')) or 1)
|
||||
|
||||
"""
|
||||
def testChannels(self):
|
||||
|
Loading…
Reference in New Issue
Block a user