Revert test and modify returned key
This commit is contained in:
parent
4d7f8e4878
commit
1cf3d66a22
@ -301,7 +301,7 @@ class KeyInfo:
|
|||||||
return key_string.lower()
|
return key_string.lower()
|
||||||
elif self.modifiers == Qt.KeypadModifier:
|
elif self.modifiers == Qt.KeypadModifier:
|
||||||
assert not is_special(self.key, self.modifiers)
|
assert not is_special(self.key, self.modifiers)
|
||||||
return key_string.lower()
|
return "<Num+{}>".format(key_string)
|
||||||
else:
|
else:
|
||||||
# Use special binding syntax, but <Ctrl-a> instead of <Ctrl-A>
|
# Use special binding syntax, but <Ctrl-a> instead of <Ctrl-A>
|
||||||
key_string = key_string.lower()
|
key_string = key_string.lower()
|
||||||
|
@ -215,14 +215,14 @@ class TestHandle:
|
|||||||
|
|
||||||
@pytest.mark.parametrize('modifiers, text', [
|
@pytest.mark.parametrize('modifiers, text', [
|
||||||
(Qt.NoModifier, '2'),
|
(Qt.NoModifier, '2'),
|
||||||
(Qt.KeypadModifier, '2'),
|
(Qt.KeypadModifier, 'num-2'),
|
||||||
])
|
])
|
||||||
def test_number_press_keypad(self, fake_keyevent, keyparser, config_stub,
|
def test_number_press_keypad(self, fake_keyevent, keyparser, config_stub,
|
||||||
modifiers, text):
|
modifiers, text):
|
||||||
"""Make sure a <Num+2> binding yields the 2 binding."""
|
"""Make sure a <Num+2> binding overrides the 2 binding."""
|
||||||
config_stub.val.bindings.commands = {'normal': {
|
config_stub.val.bindings.commands = {'normal': {
|
||||||
'2': 'message-info 2',
|
'2': 'message-info 2',
|
||||||
'<Num+2>': 'message-info 2'}}
|
'<Num+2>': 'message-info num-2'}}
|
||||||
keyparser._read_config('normal')
|
keyparser._read_config('normal')
|
||||||
keyparser.handle(fake_keyevent(Qt.Key_2, modifiers))
|
keyparser.handle(fake_keyevent(Qt.Key_2, modifiers))
|
||||||
command = 'message-info {}'.format(text)
|
command = 'message-info {}'.format(text)
|
||||||
|
Loading…
Reference in New Issue
Block a user