Allow setting mock keybindings for unit tests.
Implement mock_key_config.set_bindings_for to set bindings that will be retrieved by mock_key_config.get_bindings_for. This is useful for testing the new keyhint ui.
This commit is contained in:
parent
d506d7793f
commit
581a521b4d
@ -385,8 +385,14 @@ class KeyConfigStub:
|
||||
|
||||
"""Stub for the key-config object."""
|
||||
|
||||
def get_bindings_for(self, _section):
|
||||
return {}
|
||||
def __init__(self):
|
||||
self.bindings = {}
|
||||
|
||||
def get_bindings_for(self, section):
|
||||
return self.bindings.get(section)
|
||||
|
||||
def set_bindings_for(self, section, bindings):
|
||||
self.bindings[section] = bindings
|
||||
|
||||
|
||||
class HostBlockerStub:
|
||||
|
Loading…
Reference in New Issue
Block a user