mirror of
https://github.com/evennia/evennia.git
synced 2026-04-01 13:37:17 +02:00
The TestCommand.call() now returns the received message
This commit is contained in:
parent
a019a9d65a
commit
465a6336c5
1 changed files with 7 additions and 0 deletions
|
|
@ -48,6 +48,10 @@ class CommandTest(EvenniaTest):
|
|||
cmdobj.at_post_cmd()
|
||||
The msgreturn value is compared to eventual
|
||||
output sent to caller.msg in the game
|
||||
|
||||
Returns:
|
||||
msg (str): The received message that was sent to the caller.
|
||||
|
||||
"""
|
||||
caller = caller if caller else self.char1
|
||||
receiver = receiver if receiver else caller
|
||||
|
|
@ -61,6 +65,7 @@ class CommandTest(EvenniaTest):
|
|||
cmdobj.obj = obj or (caller if caller else self.char1)
|
||||
# test
|
||||
old_msg = receiver.msg
|
||||
returned_msg = ""
|
||||
try:
|
||||
receiver.msg = Mock()
|
||||
cmdobj.at_pre_cmd()
|
||||
|
|
@ -84,6 +89,8 @@ class CommandTest(EvenniaTest):
|
|||
finally:
|
||||
receiver.msg = old_msg
|
||||
|
||||
return returned_msg
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Individual module Tests
|
||||
# ------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue