Fixed comm-related unittest failures

This commit is contained in:
Griatch 2014-03-03 12:45:28 +01:00
parent 1a65d12b2c
commit 96f26098d1
3 changed files with 3 additions and 6 deletions

View file

@ -415,7 +415,6 @@ class CmdCemit(MuxPlayerCommand):
@cemit[/switches] <channel> = <message>
Switches:
noheader - don't show the [channel] header before the message
sendername - attach the sender's name before the message
quiet - don't echo the message back to sender
@ -447,8 +446,6 @@ class CmdCemit(MuxPlayerCommand):
message = self.rhs
if "sendername" in self.switches:
message = "%s: %s" % (self.key, message)
if not "noheader" in self.switches:
message = "[%s] %s" % (channel.key, message)
channel.msg(message)
if not "quiet" in self.switches:
string = "Sent to channel %s: %s" % (channel.key, message)

View file

@ -268,11 +268,11 @@ class TestComms(CommandTest):
self.call(comms.CmdAllCom(), "", "Available channels (use comlist,addcom and delcom to manage")
self.call(comms.CmdClock(), "testchan=send:all()", "Lock(s) applied. Current locks on testchan:")
self.call(comms.CmdCdesc(), "testchan = Test Channel", "Description of channel 'testchan' set to 'Test Channel'.")
self.call(comms.CmdCemit(), "testchan = Test Message", "Sent to channel testchan: [testchan] Test Message")
self.call(comms.CmdCemit(), "testchan = Test Message", "[testchan] Test Message|Sent to channel testchan: Test Message")
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' was destroyed.")
self.call(comms.CmdCdestroy(), "testchan" ,"[testchan] TestPlayer7: testchan is being destroyed. Make sure to change your aliases.|Channel 'testchan' was destroyed.")
from src.commands.default import batchprocess

View file

@ -221,7 +221,7 @@ class ObjectManager(TypedObjectManager):
return [obj for ind, obj in enumerate(key_candidates) if ind in index_matches]
else:
alias_candidates = self.filter(id__in=candidates_id, db_tags__db_category__iexact="objectalias")
print alias_candidates
#print alias_candidates
alias_strings = alias_candidates.values_list("db_key", flat=True)
index_matches = string_partial_matching(alias_strings, ostring, ret_index=True)
if index_matches: