'Test partial keychain timeout.'

def test_partial_keychain_timeout(self, keyparser, fake_keyevent_factory):

    timer = keyparser._partial_timer
    assert (not timer.isActive())
    keyparser.handle(fake_keyevent_factory(Qt.Key_B, text='b'))
    assert timer.isSingleShot()
    assert (timer.interval() == 100)
    assert timer.isActive()
    assert (not keyparser.execute.called)
    assert (keyparser._keystring == 'b')
    keystring_updated_mock = mock.Mock()
    keyparser.keystring_updated.connect(keystring_updated_mock)
    timer.timeout.emit()
    assert (not keyparser.execute.called)
    assert (keyparser._keystring == '')
    keystring_updated_mock.assert_called_once_with('')
