Modify the keypad test

The new behaviour is for the keypad to yield its usual key,
such that instead of a special <Num+2> keypress, it yields <2>
This commit is contained in:
George Edward Bulmer 2018-03-20 23:19:36 +00:00
parent a5dc8a3025
commit bc885cc9ee

View File

@ -215,14 +215,14 @@ class TestHandle:
@pytest.mark.parametrize('modifiers, text', [
(Qt.NoModifier, '2'),
(Qt.KeypadModifier, 'num-2'),
(Qt.KeypadModifier, '2'),
])
def test_number_press_keypad(self, fake_keyevent, keyparser, config_stub,
modifiers, text):
"""Make sure a <Num+2> binding overrides the 2 binding."""
"""Make sure a <Num+2> binding yields the 2 binding."""
config_stub.val.bindings.commands = {'normal': {
'2': 'message-info 2',
'<Num+2>': 'message-info num-2'}}
'<Num+2>': 'message-info 2'}}
keyparser._read_config('normal')
keyparser.handle(fake_keyevent(Qt.Key_2, modifiers))
command = 'message-info {}'.format(text)