From 56c524d0fe3eb76f760c316614fbe8dd2d7ca914 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 18 Aug 2019 01:23:13 +0200 Subject: Fix implicit int conversions for QKeySequence This also fixes some calls to utils.KeySequence with a string. See #4928 --- tests/unit/keyinput/test_keyutils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/unit/keyinput/test_keyutils.py') 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', [ ('', ''), ('', ''), @@ -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') -- cgit v1.2.3-54-g00ecf