def test_delay(qtbot, stubs, monkeypatch, keyhint_config, key_config_stub): timer = stubs.FakeTimer() monkeypatch.setattr('qutebrowser.misc.keyhintwidget.usertypes.Timer', lambda *_: timer) interval = 200 keyhint_config.set('ui', 'keyhint-delay', interval) key_config_stub.set_bindings_for('normal', OrderedDict([('aa', 'cmd-aa')])) keyhint = KeyHintView(0, None) keyhint.update_keyhint('normal', 'a') assert timer.interval() == interval
def test_delay(qtbot, stubs, monkeypatch, keyhint_config, key_config_stub): timer = stubs.FakeTimer() monkeypatch.setattr( 'qutebrowser.misc.keyhintwidget.usertypes.Timer', lambda *_: timer) interval = 200 keyhint_config.set('ui', 'keyhint-delay', interval) key_config_stub.set_bindings_for('normal', OrderedDict([('aa', 'cmd-aa')])) keyhint = KeyHintView(0, None) keyhint.update_keyhint('normal', 'a') assert timer.interval() == interval
def test_delay(qtbot, stubs, monkeypatch, config_stub, key_config_stub): timer = stubs.FakeTimer() monkeypatch.setattr('qutebrowser.misc.keyhintwidget.usertypes.Timer', lambda *_: timer) interval = 200 bindings = {'normal': {'aa': 'message-info cmd-aa'}} config_stub.val.keyhint.delay = interval config_stub.val.bindings.default = {} config_stub.val.bindings.commands = bindings keyhint = KeyHintView(0, None) keyhint.update_keyhint('normal', 'a') assert timer.interval() == interval
def test_delay(qtbot, stubs, monkeypatch, config_stub, key_config_stub): timer = stubs.FakeTimer() monkeypatch.setattr( 'qutebrowser.misc.keyhintwidget.usertypes.Timer', lambda *_: timer) interval = 200 bindings = {'normal': {'aa': 'message-info cmd-aa'}} config_stub.val.keyhint.delay = interval config_stub.val.bindings.default = {} config_stub.val.bindings.commands = bindings keyhint = KeyHintView(0, None) keyhint.update_keyhint('normal', 'a') assert timer.interval() == interval