diff options
author | Florian Bruhin <me@the-compiler.org> | 2019-08-18 01:23:13 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2019-08-18 02:06:09 +0200 |
commit | 56c524d0fe3eb76f760c316614fbe8dd2d7ca914 (patch) | |
tree | cf3f0b29a6aa50b7a942be731ed38f53ba6ca65c /tests | |
parent | 66ab7f263472d95e8c19bb8d67f377a6da580b44 (diff) | |
download | qutebrowser-56c524d0fe3eb76f760c316614fbe8dd2d7ca914.tar.gz qutebrowser-56c524d0fe3eb76f760c316614fbe8dd2d7ca914.zip |
Fix implicit int conversions for QKeySequence
This also fixes some calls to utils.KeySequence with a string.
See #4928
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/keyinput/test_keyutils.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/unit/keyinput/test_keyutils.py b/tests/unit/keyinput/test_keyutils.py index 8156c89ae..fd6816156 100644 --- a/tests/unit/keyinput/test_keyutils.py +++ b/tests/unit/keyinput/test_keyutils.py @@ -206,11 +206,15 @@ class TestKeySequence: seq = keyutils.KeySequence() assert not seq - @pytest.mark.parametrize('key', [Qt.Key_unknown, -1, '\x1f', 0]) + @pytest.mark.parametrize('key', [Qt.Key_unknown, -1, 0]) def test_init_unknown(self, key): with pytest.raises(keyutils.KeyParseError): keyutils.KeySequence(key) + def test_parse_unknown(self): + with pytest.raises(keyutils.KeyParseError): + keyutils.KeySequence.parse('\x1f') + @pytest.mark.parametrize('orig, normalized', [ ('<Control+x>', '<Ctrl+x>'), ('<Windows+x>', '<Meta+x>'), @@ -420,7 +424,9 @@ class TestKeySequence: def test_with_mappings(self): seq = keyutils.KeySequence.parse('foobar') - mappings = {keyutils.KeySequence('b'): keyutils.KeySequence('t')} + mappings = { + keyutils.KeySequence.parse('b'): keyutils.KeySequence.parse('t') + } seq2 = seq.with_mappings(mappings) assert seq2 == keyutils.KeySequence.parse('footar') |