Fix except-finally section that swallowed command unittest error message. Resolves #1629.
This commit is contained in:
parent
42038737ff
commit
1923689040
3 changed files with 30 additions and 23 deletions
|
|
@ -10,6 +10,9 @@
|
||||||
- Made Portal the AMP Server for starting/restarting the Server (the AMP client)
|
- Made Portal the AMP Server for starting/restarting the Server (the AMP client)
|
||||||
- Dynamic logging now happens using `evennia -l` rather than by interactive.
|
- Dynamic logging now happens using `evennia -l` rather than by interactive.
|
||||||
- Made AMP secure against erroneous HTTP requests on the wrong port (return error messages).
|
- Made AMP secure against erroneous HTTP requests on the wrong port (return error messages).
|
||||||
|
- The `evennia istart` option will start/switch the Server in foreground (interactive) mode, where it logs
|
||||||
|
to terminal and can be stopped with Ctrl-C. Using `evennia reload`, or reloading in-game, will
|
||||||
|
return Server to normal daemon operation.
|
||||||
|
|
||||||
### Prototype changes
|
### Prototype changes
|
||||||
|
|
||||||
|
|
@ -26,9 +29,13 @@
|
||||||
change from Evennia 0.7 which allowed 'mixin' prototypes without `typeclass`/`prototype_key`. To
|
change from Evennia 0.7 which allowed 'mixin' prototypes without `typeclass`/`prototype_key`. To
|
||||||
make a mixin now, give it a default typeclass, like `evennia.objects.objects.DefaultObject` and just
|
make a mixin now, give it a default typeclass, like `evennia.objects.objects.DefaultObject` and just
|
||||||
override in the child as needed.
|
override in the child as needed.
|
||||||
|
- Spawning an object using a prototype will automatically assign a new tag to it, named the same as
|
||||||
|
the `prototype_key` and with the category `from_prototype`.
|
||||||
- The spawn command was extended to accept a full prototype on one line.
|
- The spawn command was extended to accept a full prototype on one line.
|
||||||
- The spawn command got the /save switch to save the defined prototype and its key.
|
- The spawn command got the /save switch to save the defined prototype and its key.
|
||||||
- The command spawn/menu will now start an OLC (OnLine Creation) menu to load/save/edit/spawn prototypes.
|
- The command spawn/menu will now start an OLC (OnLine Creation) menu to load/save/edit/spawn prototypes.
|
||||||
|
- The OLC allows for updating all objects previously created using a given prototype with any
|
||||||
|
changes done.
|
||||||
|
|
||||||
### EvMenu
|
### EvMenu
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ class CmdLook(COMMAND_DEFAULT_CLASS):
|
||||||
target = caller.search(self.args)
|
target = caller.search(self.args)
|
||||||
if not target:
|
if not target:
|
||||||
return
|
return
|
||||||
self.msg((caller.at_look(target), {'type':'look'}), options=None)
|
self.msg((caller.at_look(target), {'type': 'look'}), options=None)
|
||||||
|
|
||||||
|
|
||||||
class CmdNick(COMMAND_DEFAULT_CLASS):
|
class CmdNick(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
|
||||||
|
|
@ -105,28 +105,28 @@ class CommandTest(EvenniaTest):
|
||||||
pass
|
pass
|
||||||
except InterruptCommand:
|
except InterruptCommand:
|
||||||
pass
|
pass
|
||||||
finally:
|
|
||||||
# clean out evtable sugar. We only operate on text-type
|
# clean out evtable sugar. We only operate on text-type
|
||||||
stored_msg = [args[0] if args and args[0] else kwargs.get("text", utils.to_str(kwargs, force_string=True))
|
stored_msg = [args[0] if args and args[0] else kwargs.get("text", utils.to_str(kwargs, force_string=True))
|
||||||
for name, args, kwargs in receiver.msg.mock_calls]
|
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
|
# 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 = [smsg[0] if isinstance(smsg, tuple) else smsg for smsg in stored_msg]
|
||||||
if msg is not None:
|
if msg is not None:
|
||||||
# set our separator for returned messages based on parsing ansi or not
|
# set our separator for returned messages based on parsing ansi or not
|
||||||
msg_sep = "|" if noansi else "||"
|
msg_sep = "|" if noansi else "||"
|
||||||
# Have to strip ansi for each returned message for the regex to handle it correctly
|
# Have to strip ansi for each returned message for the regex to handle it correctly
|
||||||
returned_msg = msg_sep.join(_RE.sub("", ansi.parse_ansi(mess, strip_ansi=noansi))
|
returned_msg = msg_sep.join(_RE.sub("", ansi.parse_ansi(mess, strip_ansi=noansi))
|
||||||
for mess in stored_msg).strip()
|
for mess in stored_msg).strip()
|
||||||
if msg == "" and returned_msg or not returned_msg.startswith(msg.strip()):
|
if msg == "" and returned_msg or not returned_msg.startswith(msg.strip()):
|
||||||
sep1 = "\n" + "=" * 30 + "Wanted message" + "=" * 34 + "\n"
|
sep1 = "\n" + "=" * 30 + "Wanted message" + "=" * 34 + "\n"
|
||||||
sep2 = "\n" + "=" * 30 + "Returned message" + "=" * 32 + "\n"
|
sep2 = "\n" + "=" * 30 + "Returned message" + "=" * 32 + "\n"
|
||||||
sep3 = "\n" + "=" * 78
|
sep3 = "\n" + "=" * 78
|
||||||
retval = sep1 + msg.strip() + sep2 + returned_msg + sep3
|
retval = sep1 + msg.strip() + sep2 + returned_msg + sep3
|
||||||
raise AssertionError(retval)
|
raise AssertionError(retval)
|
||||||
else:
|
else:
|
||||||
returned_msg = "\n".join(str(msg) for msg in stored_msg)
|
returned_msg = "\n".join(str(msg) for msg in stored_msg)
|
||||||
returned_msg = ansi.parse_ansi(returned_msg, strip_ansi=noansi).strip()
|
returned_msg = ansi.parse_ansi(returned_msg, strip_ansi=noansi).strip()
|
||||||
receiver.msg = old_msg
|
receiver.msg = old_msg
|
||||||
|
|
||||||
return returned_msg
|
return returned_msg
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue