Fixed up some channel-related errors and made unittests run again.

This commit is contained in:
Griatch 2013-10-18 21:01:53 +02:00
parent bf786705b8
commit 4c650a44a6
3 changed files with 5 additions and 7 deletions

View file

@ -254,13 +254,13 @@ class CmdChannels(MuxPlayerCommand):
# all channels we have available to listen to
channels = [chan for chan in ChannelDB.objects.get_all_channels() if chan.access(caller, 'listen')]
print channels
#print channels
if not channels:
self.msg("No channels available.")
return
# all channel we are already subscribed to
subs = [conn.channel for conn in PlayerChannelConnection.objects.get_all_player_connections(caller)]
print subs
#print subs
if self.cmdstring == "comlist":
# just display the subscribed channels with no extra info
@ -320,7 +320,7 @@ class CmdCdestroy(MuxPlayerCommand):
channel.msg(msgobj)
channel.delete()
CHANNELHANDLER.update()
self.msg("%s was destroyed." % channel)
self.msg("Channel '%s' was destroyed." % channel)
class CmdCBoot(MuxPlayerCommand):
"""

View file

@ -134,7 +134,6 @@ class CommandTest(TestCase):
retval = sep1 + msg.strip() + sep2 + returned_msg + sep3
raise AssertionError(retval)
#------------------------------------------------------------
# Individual module Tests
#------------------------------------------------------------
@ -253,7 +252,7 @@ class TestComms(CommandTest):
self.call(comms.CmdCWho(), "testchan", "Channel subscriptions\ntestchan:\n TestPlayer7")
self.call(comms.CmdPage(), "TestPlayer7b = Test", "You paged TestPlayer7b with: 'Test'.")
self.call(comms.CmdCBoot(), "", "Usage: @cboot[/quiet] <channel> = <player> [:reason]") # noone else connected to boot
self.call(comms.CmdCdestroy(), "testchan" ,"Channel 'testchan' (Test Channel) was destroyed.")
self.call(comms.CmdCdestroy(), "testchan" ,"Channel 'testchan' was destroyed.")
from src.commands.default import batchprocess
class TestBatchProcess(CommandTest):

View file

@ -136,7 +136,6 @@ class Msg(SharedMemoryModel):
elif typ == 'external':
self.db_sender_external = "1"
self.extra_senders.append(obj)
print "I ran!"
elif isinstance(typ, basestring):
self.db_sender_external = obj
elif not obj:
@ -599,7 +598,7 @@ class ExternalChannelConnection(SharedMemoryModel):
# make sure we are not echoing back our own message to ourselves
# (this would result in a nasty infinite loop)
print senders
#print senders
if self in make_iter(senders):#.external_key:
return