Forgot to stub out one method for the test

This commit is contained in:
Kovid Goyal
2024-01-25 14:18:09 +05:30
parent cd30de3727
commit d6e55f72c0
2 changed files with 8 additions and 5 deletions

View File

@@ -69,11 +69,7 @@ class Mappings:
def update_keymap(self, global_shortcuts:Optional[Dict[str, SingleKey]] = None) -> None: def update_keymap(self, global_shortcuts:Optional[Dict[str, SingleKey]] = None) -> None:
if global_shortcuts is None: if global_shortcuts is None:
if is_macos: global_shortcuts = self.set_cocoa_global_shortcuts(self.get_options()) if is_macos else {}
from .main import set_cocoa_global_shortcuts
global_shortcuts = set_cocoa_global_shortcuts(self.get_options())
else:
global_shortcuts = {}
self.global_shortcuts_map: KeyMap = {v: [KeyDefinition(definition=k)] for k, v in global_shortcuts.items()} self.global_shortcuts_map: KeyMap = {v: [KeyDefinition(definition=k)] for k, v in global_shortcuts.items()}
self.global_shortcuts = global_shortcuts self.global_shortcuts = global_shortcuts
self.keyboard_modes = self.get_options().keyboard_modes.copy() self.keyboard_modes = self.get_options().keyboard_modes.copy()
@@ -224,4 +220,8 @@ class Mappings:
b = get_boss() b = get_boss()
if b.args.debug_keyboard: if b.args.debug_keyboard:
print(*args, end=end, flush=True) print(*args, end=end, flush=True)
def set_cocoa_global_shortcuts(self, opts: Options) -> Dict[str, SingleKey]:
from .main import set_cocoa_global_shortcuts
return set_cocoa_global_shortcuts(opts)
# }}} # }}}

View File

@@ -553,6 +553,9 @@ class TestKeys(BaseTest):
def set_ignore_os_keyboard_processing(self, on: bool) -> None: def set_ignore_os_keyboard_processing(self, on: bool) -> None:
pass pass
def set_cocoa_global_shortcuts(self, opts):
return {}
def get_options(self): def get_options(self):
return self.options return self.options