示例#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'
示例#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'
示例#3
0
 def _getmodeclass(self):
     return lambda: searchdlgmode.SearchDlgMode(
         target=kaa_testutils._TestScreenBase()._getwnd(''))
示例#4
0
 def _getmodeclass(self):
     return lambda :searchdlgmode.SearchDlgMode(
         target=kaa_testutils._TestScreenBase()._getwnd(''))
示例#5
0
 def _run(self, s, pos):
     target = kaa_testutils._TestScreenBase()._getwnd(s)
     doc = wordcompletemode.WordCompleteInputMode.build(target)
     return doc.mode._get_target_word(pos)