Esempio n. 1
0
    def test_parse_menu_fail(self):
        template = """
        ## NODE

        Text

        ## OPTIONS

        next: callnode2(invalid)
        """
        with self.assertRaises(RuntimeError):
            evmenu.parse_menu_template(self.char1, template, self.goto_callables)
Esempio n. 2
0
def init_menu(caller):
    """
    Call to initialize the menu.

    """
    menutree = parse_menu_template(caller, MENU_TEMPLATE, GOTO_CALLABLES)
    TutorialEvMenu(caller, menutree)
Esempio n. 3
0
    def test_parse_menu_template(self):
        """EvMenu template testing"""

        menutree = evmenu.parse_menu_template(self.char1, self.menu_template,
                                              self.goto_callables)
        self.assertEqual(menutree, {
            "start": Anything,
            "node1": Anything,
            "node2": Anything
        })