Show the keystring correctly when entering a count
This commit is contained in:
parent
514138aad2
commit
9b9d7647a4
@ -166,6 +166,7 @@ class BaseKeyParser(QObject):
|
|||||||
assert len(txt) == 1, txt
|
assert len(txt) == 1, txt
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
self._count += txt
|
self._count += txt
|
||||||
|
self.keystring_updated.emit(self._count + str(self._sequence))
|
||||||
return QKeySequence.ExactMatch
|
return QKeySequence.ExactMatch
|
||||||
|
|
||||||
if dry_run:
|
if dry_run:
|
||||||
|
@ -281,6 +281,14 @@ class TestCount:
|
|||||||
keyparser.execute.assert_called_once_with('message-info ccc', 23)
|
keyparser.execute.assert_called_once_with('message-info ccc', 23)
|
||||||
assert not keyparser._sequence
|
assert not keyparser._sequence
|
||||||
|
|
||||||
|
def test_count_keystring_update(self, qtbot, handle_text, keyparser):
|
||||||
|
"""Make sure the keystring is updated correctly when entering count."""
|
||||||
|
with qtbot.waitSignals([keyparser.keystring_updated, keyparser.keystring_updated]) as blocker:
|
||||||
|
handle_text(Qt.Key_4, Qt.Key_2)
|
||||||
|
sig1, sig2 = blocker.all_signals_and_args
|
||||||
|
assert sig1.args == ('4',)
|
||||||
|
assert sig2.args == ('42',)
|
||||||
|
|
||||||
|
|
||||||
def test_clear_keystring(qtbot, keyparser):
|
def test_clear_keystring(qtbot, keyparser):
|
||||||
"""Test that the keystring is cleared and the signal is emitted."""
|
"""Test that the keystring is cleared and the signal is emitted."""
|
||||||
|
Loading…
Reference in New Issue
Block a user