From f64a44ce357af35e0fdfe82de1cb760d155dbd74 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 9 Aug 2019 08:44:39 +0200 Subject: [PATCH] Fix unit tests for new py style --- evennia/commands/default/tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index a3042a3ef1..e9fc889812 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -114,8 +114,9 @@ class CommandTest(EvenniaTest): stored_msg = [args[0] if args and args[0] else kwargs.get("text", utils.to_str(kwargs)) for name, args, kwargs in receiver.msg.mock_calls] # Get the first element of a tuple if msg received a tuple instead of a string - stored_msg = [smsg[0] if isinstance(smsg, tuple) else smsg for smsg in stored_msg] + stored_msg = [str(smsg[0]) if isinstance(smsg, tuple) else str(smsg) for smsg in stored_msg] if msg is not None: + msg = str(msg) # to be safe, e.g. `py` command may return ints # set our separator for returned messages based on parsing ansi or not msg_sep = "|" if noansi else "||" # Have to strip ansi for each returned message for the regex to handle it correctly @@ -219,7 +220,7 @@ class TestSystem(CommandTest): def test_py(self): # we are not testing CmdReload, CmdReset and CmdShutdown, CmdService or CmdTime # since the server is not running during these tests. - self.call(system.CmdPy(), "1+2", ">>> 1+2|3") + self.call(system.CmdPy(), "1+2", '>>> 1+2|3') self.call(system.CmdPy(), "/clientraw 1+2", ">>> 1+2|3") def test_scripts(self):