Change testing keyword to _testing in cmdhandler

This commit is contained in:
Griatch 2014-08-24 10:55:02 +02:00
parent 7bba75b9ff
commit 58f6c05964
2 changed files with 5 additions and 5 deletions

View file

@ -251,13 +251,13 @@ def get_and_merge_cmdsets(caller, session, player, obj,
# Main command-handler function # Main command-handler function
@inlineCallbacks @inlineCallbacks
def cmdhandler(called_by, raw_string, testing=False, callertype="session", sessid=None, **kwargs): def cmdhandler(called_by, raw_string, _testing=False, callertype="session", sessid=None, **kwargs):
""" """
This is the main function to handle any string sent to the engine. This is the main function to handle any string sent to the engine.
called_by - object on which this was called from. This is either a Session, a Player or an Object. called_by - object on which this was called from. This is either a Session, a Player or an Object.
raw_string - the command string given on the command line raw_string - the command string given on the command line
testing - if we should actually execute the command or not. _testing - if we should actually execute the command or not.
if True, the command instance will be returned instead. if True, the command instance will be returned instead.
callertype - this is one of "session", "player" or "object", in decending callertype - this is one of "session", "player" or "object", in decending
order. So when the Session is the caller, it will merge its order. So when the Session is the caller, it will merge its
@ -392,7 +392,7 @@ def cmdhandler(called_by, raw_string, testing=False, callertype="session", sessi
# we make sure to validate its scripts. # we make sure to validate its scripts.
yield cmd.obj.scripts.validate() yield cmd.obj.scripts.validate()
if testing: if _testing:
# only return the command instance # only return the command instance
returnValue(cmd) returnValue(cmd)
@ -446,7 +446,7 @@ def cmdhandler(called_by, raw_string, testing=False, callertype="session", sessi
# we make sure to validate its scripts. # we make sure to validate its scripts.
yield syscmd.obj.scripts.validate() yield syscmd.obj.scripts.validate()
if testing: if _testing:
# only return the command instance # only return the command instance
returnValue(syscmd) returnValue(syscmd)

View file

@ -7,7 +7,7 @@ class TestGetAndMergeCmdsets(unittest.TestCase):
class TestCmdhandler(unittest.TestCase): class TestCmdhandler(unittest.TestCase):
def test_cmdhandler(self): def test_cmdhandler(self):
# self.assertEqual(expected, cmdhandler(called_by, raw_string, testing, callertype, sessid)) # self.assertEqual(expected, cmdhandler(called_by, raw_string, _testing, callertype, sessid))
assert True # TODO: implement your test here assert True # TODO: implement your test here
if __name__ == '__main__': if __name__ == '__main__':