From 609b1777c74f96b0e8bad5d7b6ab839ae87a8c95 Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Sun, 18 Oct 2015 01:15:17 +0000 Subject: [PATCH] Extend EvMenu test case. There is now a custom look command, which was not possible with the previous implementation which used execute_cmd('look'), because that would infinitely recurse. --- evennia/utils/evmenu.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index cb9615d91..489f23b8a 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -706,6 +706,9 @@ def test_start_node(caller): "desc": "Set an attribute on yourself.", "exec": lambda caller: caller.attributes.add("menuattrtest", "Test value"), "goto": "test_set_node"}, + {"key": ("{yL{nook", "l"), + "desc": "Look and see a custom message.", + "goto": "test_look_node"}, {"key": ("{yV{niew", "v"), "desc": "View your own name", "goto": "test_view_node"}, @@ -717,6 +720,13 @@ def test_start_node(caller): return text, options +def test_look_node(caller): + text = "Looking again will take you back to the previous message." + options = {"key": ("{yL{nook", "l"), + "desc": "Go back to the previous menu.", + "goto": "test_start_node"} + return text, options + def test_set_node(caller): text = (""" The attribute 'menuattrtest' was set to