Fixed up some channel-related errors and made unittests run again.
This commit is contained in:
parent
bf786705b8
commit
4c650a44a6
3 changed files with 5 additions and 7 deletions
|
|
@ -254,13 +254,13 @@ class CmdChannels(MuxPlayerCommand):
|
||||||
|
|
||||||
# all channels we have available to listen to
|
# all channels we have available to listen to
|
||||||
channels = [chan for chan in ChannelDB.objects.get_all_channels() if chan.access(caller, 'listen')]
|
channels = [chan for chan in ChannelDB.objects.get_all_channels() if chan.access(caller, 'listen')]
|
||||||
print channels
|
#print channels
|
||||||
if not channels:
|
if not channels:
|
||||||
self.msg("No channels available.")
|
self.msg("No channels available.")
|
||||||
return
|
return
|
||||||
# all channel we are already subscribed to
|
# all channel we are already subscribed to
|
||||||
subs = [conn.channel for conn in PlayerChannelConnection.objects.get_all_player_connections(caller)]
|
subs = [conn.channel for conn in PlayerChannelConnection.objects.get_all_player_connections(caller)]
|
||||||
print subs
|
#print subs
|
||||||
|
|
||||||
if self.cmdstring == "comlist":
|
if self.cmdstring == "comlist":
|
||||||
# just display the subscribed channels with no extra info
|
# just display the subscribed channels with no extra info
|
||||||
|
|
@ -320,7 +320,7 @@ class CmdCdestroy(MuxPlayerCommand):
|
||||||
channel.msg(msgobj)
|
channel.msg(msgobj)
|
||||||
channel.delete()
|
channel.delete()
|
||||||
CHANNELHANDLER.update()
|
CHANNELHANDLER.update()
|
||||||
self.msg("%s was destroyed." % channel)
|
self.msg("Channel '%s' was destroyed." % channel)
|
||||||
|
|
||||||
class CmdCBoot(MuxPlayerCommand):
|
class CmdCBoot(MuxPlayerCommand):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,6 @@ class CommandTest(TestCase):
|
||||||
retval = sep1 + msg.strip() + sep2 + returned_msg + sep3
|
retval = sep1 + msg.strip() + sep2 + returned_msg + sep3
|
||||||
raise AssertionError(retval)
|
raise AssertionError(retval)
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
# Individual module Tests
|
# Individual module Tests
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
|
|
@ -253,7 +252,7 @@ class TestComms(CommandTest):
|
||||||
self.call(comms.CmdCWho(), "testchan", "Channel subscriptions\ntestchan:\n TestPlayer7")
|
self.call(comms.CmdCWho(), "testchan", "Channel subscriptions\ntestchan:\n TestPlayer7")
|
||||||
self.call(comms.CmdPage(), "TestPlayer7b = Test", "You paged TestPlayer7b with: 'Test'.")
|
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.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
|
from src.commands.default import batchprocess
|
||||||
class TestBatchProcess(CommandTest):
|
class TestBatchProcess(CommandTest):
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,6 @@ class Msg(SharedMemoryModel):
|
||||||
elif typ == 'external':
|
elif typ == 'external':
|
||||||
self.db_sender_external = "1"
|
self.db_sender_external = "1"
|
||||||
self.extra_senders.append(obj)
|
self.extra_senders.append(obj)
|
||||||
print "I ran!"
|
|
||||||
elif isinstance(typ, basestring):
|
elif isinstance(typ, basestring):
|
||||||
self.db_sender_external = obj
|
self.db_sender_external = obj
|
||||||
elif not obj:
|
elif not obj:
|
||||||
|
|
@ -599,7 +598,7 @@ class ExternalChannelConnection(SharedMemoryModel):
|
||||||
|
|
||||||
# make sure we are not echoing back our own message to ourselves
|
# make sure we are not echoing back our own message to ourselves
|
||||||
# (this would result in a nasty infinite loop)
|
# (this would result in a nasty infinite loop)
|
||||||
print senders
|
#print senders
|
||||||
if self in make_iter(senders):#.external_key:
|
if self in make_iter(senders):#.external_key:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue