Commit Graph

118 Commits

Author SHA1 Message Date
Florian Bruhin
4223e2f85d Check all keys against QTest::keyToAscii 2018-03-04 20:21:57 +01:00
Fritz Reichwald
d28c323074 Add printable and ismodifier test 2018-03-04 20:21:57 +01:00
Florian Bruhin
934d586286 Fix handling of Shift-Tab aka. Backtab 2018-03-04 20:21:57 +01:00
Florian Bruhin
63e05e12ba Fix lint and tests 2018-03-04 20:21:57 +01:00
Florian Bruhin
2ca15d7667 Add tests for lower-/uppercase text 2018-03-04 20:20:31 +01:00
Florian Bruhin
8c87040cb6 Improve IDs for qt_key fixture 2018-03-04 20:20:31 +01:00
Florian Bruhin
0b6d2c2b0a Make all key names work 2018-03-04 20:20:30 +01:00
Florian Bruhin
601e56d2fa Make test_keyutils work 2018-03-04 20:20:30 +01:00
Florian Bruhin
8f479407a0 key_data: Update key names to reflect reality
Generated by:

import key_data
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeySequence

for key in key_data.KEYS:
    attr = key.attribute
    member = getattr(Qt, 'Key_' + attr, None)
    if member is None:
        continue
    name = QKeySequence(member).toString()
    if name != attr:
        try:
            print("    Key('{}', '{}')".format(attr, name))
        except UnicodeEncodeError:
            print("    Key('{}', '{}')  # FIXME".format(attr, name.encode('unicode-escape').decode('ascii')))
    else:
        print()
2018-03-04 20:20:30 +01:00
Florian Bruhin
f714be0ff7 Initial tests on all Qt keys 2018-03-04 20:20:30 +01:00
Florian Bruhin
19512e988b Expose less from keyutils publicly 2018-03-04 20:20:30 +01:00
Florian Bruhin
fdc2458657 Fix test_split_count after _handle_key merge 2018-03-04 20:20:30 +01:00
Florian Bruhin
c3485821c7 Adjust copyright 2018-03-04 20:20:30 +01:00
Florian Bruhin
49d297f7bf Fix tests for parsing KeySequences 2018-02-27 14:10:55 +01:00
Florian Bruhin
ec3ad8a969 Get rid of _warn_on_keychains and _supports_chains 2018-02-27 13:02:32 +01:00
Florian Bruhin
ba012c6ba8 Get rid of BaseKeyparser.Type 2018-02-27 13:01:41 +01:00
Florian Bruhin
362f923f06 Fix lint 2018-02-27 09:34:55 +01:00
Florian Bruhin
1ba61bbcbe Fix test_modeparsers 2018-02-27 09:22:01 +01:00
Florian Bruhin
911b2daebf Fix test_keyutils 2018-02-27 09:07:20 +01:00
Florian Bruhin
5a03d31f6f More test_basekeyparser fixes 2018-02-27 08:53:28 +01:00
Florian Bruhin
9e27f2b3e7 Initial attempts at fixing test_basekeyparser 2018-02-27 08:48:16 +01:00
Florian Bruhin
321d5c5d20 Merge branch 'master' into keys 2018-02-25 21:25:12 +01:00
Florian Bruhin
6f028e9ad0 Update copyright years 2018-02-05 12:19:50 +01:00
Fritz Reichwald
9b4da25578 Fix another test by using the new KeySequence 2018-01-07 00:11:47 +01:00
Florian Bruhin
917f2a30de Get tests to collect 2017-12-29 13:23:38 +01:00
Florian Bruhin
5cee39d315 Initial move of keyutils tests 2017-12-29 01:41:55 +01:00
Florian Bruhin
e76732693c Fix wrong import order 2017-12-15 14:35:07 +01:00
Florian Bruhin
e27c54a5c1 Fix modeparser tests 2017-09-22 19:49:52 +02:00
Florian Bruhin
1e2015be65 Make bindings win over mappings
Fixes #2995
2017-09-22 17:13:17 +02:00
Florian Bruhin
ef1c83862b Use utils.is_* for platform checks everywhere 2017-09-20 11:10:24 +02:00
Florian Bruhin
1fc9817cd4 Remove support for ambiguous keybindings 2017-09-14 00:37:01 +02:00
Florian Bruhin
cff61fa0bc Fix pylint
This also reverts commit 8df0b063be.
2017-07-04 15:34:10 +02:00
Florian Bruhin
9dfe4429d7 Import qutebrowser.app in conftest 2017-07-04 15:08:04 +02:00
Florian Bruhin
4bebfd8d5f Update test_modeparsers for new config 2017-07-04 15:08:04 +02:00
Florian Bruhin
d5cd0b19b0 Update test_basekeyparser for new config 2017-07-04 15:08:04 +02:00
Florian Bruhin
ea2fbc427a tests: Use match= for pytest.raises 2017-05-23 09:36:00 +02:00
Florian Bruhin
00a7a0cee6 Reorganize pylint config
This removes various stuff we don't need anymoe, and also re-enables and fixes
the import order check.
2017-05-17 20:20:12 +02:00
Florian Bruhin
822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Florian Bruhin
ca4f249c30 Use three-argument form of monkeypatch.*attr 2017-03-01 11:33:41 +01:00
Florian Bruhin
de50f30b9b Replace all GitHub links 2017-02-05 00:13:11 +01:00
Florian Bruhin
552e0551af Revert zero counts
This initially seemed like a nice feature, but it means 0 can't be bound
as a separate key anymore, and 0<Esc> gives weird error messages...

Reverts #1953.
Fixes #2032.
2016-11-23 08:37:29 +01:00
Florian Bruhin
2ef85d6c35 Fix macros with a mode-switching command 2016-11-10 07:16:52 +01:00
Florian Bruhin
c80f18522c Remove now-duplicate test
TestKeychain.test_count_0 now tests the exact same thing.
2016-09-30 18:17:28 +02:00
Florian Bruhin
28c87b5c6b Use right key in test_basekeyparser 2016-09-30 18:15:59 +02:00
Florian Bruhin
822c100f52 Make 0 a usable count for :tab-focus
Fixes #1768
2016-09-30 08:33:16 +02:00
Florian Bruhin
df3733af54 tests: Use pytest.fixture instead of yield_fixture
See #1877
2016-08-22 07:40:24 +02:00
Florian Bruhin
f4b72d4b24 Revert "Revert "Handle counts for special keys.""
This reverts commit 2d5ffbfd02.
2016-08-16 13:44:28 +02:00
Florian Bruhin
fd8e66136f tests: Add a mode_manager fixture 2016-07-10 17:04:25 +02:00
Florian Bruhin
2d5ffbfd02 Revert "Handle counts for special keys."
This reverts commit c881730fad.

This is just a temporary solution until we can properly fix this.

See #1464
2016-04-29 14:20:11 +02:00
Florian Bruhin
8b227f4ba4 Merge branch 'special_key_count' of https://github.com/rcorre/qutebrowser into rcorre-special_key_count 2016-04-28 22:22:23 +02:00
Ryan Roden-Corrent
c881730fad Handle counts for special keys.
Now 3<ctrl-o> will execute whatever <ctrl-o> is mapped to with count=3.
2016-04-19 23:39:02 -04:00
Ryan Roden-Corrent
4b00a17d71 Fix MarkKeyParser crash when changing keyconfig.
Ensure MarkKeyParser implements on_keyconfig_changed, so it doesn't fail when
rebinding a key. It doesn't have keybindings, so the implementation is just
`pass`.

This also fixes a few flake8 style errors.
2016-04-17 21:04:08 -04:00
Florian Bruhin
5311576c34 Check pep257 via flake8.
We'll still keep the pydocstyle environment though until flake8-pep257 adds
support for that:

https://github.com/Robpol86/flake8-pep257/issues/6
2016-02-10 19:18:47 +01:00
Florian Bruhin
1fb34331e5 tests: Default to raising=True for qtbot.
- qtbot.waitSignal with raising=True is the default this way, so we remove the
  raising=True.
- qtbot.waitSignal with raising=False stay untouched
- Some qtbot.waitSignal without raising had one added (because we don't want it
  to raise)
- Some qtbot.waitSignal without raising actually should've raised, which they
  do now.
2016-01-08 09:49:06 +01:00
Florian Bruhin
a5f2ac5f03 Adjust copyright years. 2016-01-04 07:12:39 +01:00
Florian Bruhin
c1d3a94936 Don't pass through shifted characters.
See #1207 - turns out that was a problem for *any* character.
2016-01-04 07:10:23 +01:00
Florian Bruhin
803398c49b Use some more fixtures for older tests. 2015-12-01 22:40:58 +01:00
Florian Bruhin
416cfaf002 tests: Switch from pytest-capturelog to catchlog. 2015-11-11 19:57:03 +01:00
Florian Bruhin
182dd26fb7 Refactor test_basekeyparser. 2015-08-26 23:02:23 +02:00
Florian Bruhin
1f26b3090c tests: Add _debug_log test for BaseKeyParser. 2015-08-26 20:38:29 +02:00
Alexander Cogneau
cd34fc4b57 Small changes to basekeyparser tests 2015-08-26 12:13:47 +02:00
Alexander Cogneau
f54295f95c Test _warn_on_keychains. 2015-08-25 16:28:02 +02:00
Alexander Cogneau
09161faca5 Refactor read_config for easier testing 2015-08-25 12:04:22 +02:00
Alexander Cogneau
05eb9bd08c Remove unnecessary lines 2015-08-25 10:28:46 +02:00
Alexander Cogneau
1a227ae3a7 pytestqt is not required 2015-08-24 19:29:50 +02:00
Alexander Cogneau
af9647221a Add tests for BaseKeyParser 2015-08-24 18:12:12 +02:00
Alexander Cogneau
193a8d5242 Add unit tests for KeyInput.BaseKeyParser 2015-08-22 23:26:13 +02:00
Florian Bruhin
2c5269acd6 Reorganize tests directory. 2015-08-18 20:19:02 +02:00