Beispiel #1
0
    def test_msbbox(self, mock):

        target = kaa_testutils._TestScreenBase()._getwnd('')
        doc = mainmenumode.MenuMode.build_menu(target,
                               [('&File', ('testmenu',)),
                                ('&edit', ('menu.edit',)),])

        value = 0
        def f(wnd):
            nonlocal value
            value = 'updated'
        target.document.mode.commands['testmenu'] = f
        doc.mode.on_str(kaa_testutils._TestScreenBase()._getwnd(''), 'f')

        assert value == 'updated'
Beispiel #2
0
    def test_msbbox(self):
        kaa.app.DEFAULT_THEME = 'basic'

        target = kaa_testutils._TestScreenBase()._getwnd('')
        doc = menumode.MenuMode.show_menu(target, 'MAIN')
        doc.mode.on_str(None, 'f')

        name, args, kwargs = kaa.app.show_dialog.mock_calls[-1]
        assert args[0].mode.itemname == 'FILE'
Beispiel #3
0
 def _getmodeclass(self):
     return lambda: searchdlgmode.SearchDlgMode(
         target=kaa_testutils._TestScreenBase()._getwnd(''))
Beispiel #4
0
 def _getmodeclass(self):
     return lambda :searchdlgmode.SearchDlgMode(
         target=kaa_testutils._TestScreenBase()._getwnd(''))
 def _run(self, s, pos):
     target = kaa_testutils._TestScreenBase()._getwnd(s)
     doc = wordcompletemode.WordCompleteInputMode.build(target)
     return doc.mode._get_target_word(pos)