Commit Graph

994 Commits

Author SHA1 Message Date
Daniel Karbach
cfa9068eed flake...
*quitely shakes fist and then submits*
2016-10-28 11:23:05 +02:00
Daniel Karbach
6fff45daeb check exception messages in utilcmds tests 2016-10-28 10:50:58 +02:00
Daniel Karbach
e167f77d68 separate test for hunter exceptions 2016-10-28 10:44:55 +02:00
Daniel Karbach
6e510372fb more cleanup
jeez, this is getting embarrassing
2016-10-27 15:50:17 +02:00
Daniel Karbach
23a62e952d another lineparser/utilcmds test revision
* verify exception message in lineparser double open
* check for hunter with `pytest.importorskip`
* stricter exception checking in debug_trace test
2016-10-27 14:56:28 +02:00
Daniel Karbach
64cf8fcd39 lineparser/utilcmds test cleanup
* fix date in copyright
* remove redundant class docstrings
* don't rename utilcmds module in unit test
* use `mode_manager` fixture in place of FakeModeMan
* some whitespace
2016-10-27 14:23:01 +02:00
Florian Bruhin
96b4ab41c7 Re-add label.show() call
We don't actually show a window (so no need to use
waitForWindowShown/waitExposed), but we still need to make sure the
label is shown.
2016-10-26 14:54:35 +02:00
Florian Bruhin
c7bfefeb08 tests: Remove useless show() call
We add it to a layout anyways, so it will already be shown.
2016-10-26 08:08:00 +02:00
Florian Bruhin
ece3f3a2e1 Update to pytest-qt 2.1.0 2016-10-26 07:42:41 +02:00
Daniel Karbach
442549555b skip segfault test on windows
while technically possible (on both machine and OS level), termination due
to SIGSEGV cannot be prevented
maybe the test could be rewritten to spawn a subprocess and check its exit
status (of 11)
2016-10-25 17:24:14 +02:00
Joel Bradshaw
3fe050f850 Update test for version bump 2016-10-25 07:11:56 -07:00
Daniel Karbach
9038b28ea4 different mocking of open() in lineparser test
apparently, python 3.4 (and less, probably) does not import
builtins into modules
2016-10-25 08:52:08 +02:00
Daniel Karbach
b5ffe979aa "typo" in utilcmds test 2016-10-25 08:48:04 +02:00
Daniel Karbach
e0d1fafe43 tests for misc.utilcmds 2016-10-24 17:13:38 +02:00
Daniel Karbach
bdb96becd6 unit tests for misc.lineparser 2016-10-24 17:10:47 +02:00
Ryan Roden-Corrent
fbc084e416 Remove :<count>:cmd syntax support.
CommandRunner.parse had some logic for handling commands of form
:<count>:cmd. However, this complicated the parsing logic for something
that appears to only be used in tests. One could use it in a
userscript, but this is unlikely as it is undocumented. Removing
support for this simplifies the logic of parse.

The commnd `run-with-count` is added to provide this functionality.
It works like `repeat` but passes the count along to the command
instead of running the command multiple times.

This resolves #1997: Qutebrowser crashes when pasting commands.
This bug was caused by excess stripping of ':' from the command string
by _parse_count.
2016-10-10 08:02:30 -04:00
Daniel Schadt
a9ac123bfa tests: relax pdfjs tests
Updating the whole snippet in two places is bad, so we relax the testing
code.
2016-10-06 16:18:21 +02:00
Florian Bruhin
5e6d8e3944 Merge branch 'master' of https://github.com/sebastian-frysztak/qutebrowser into sebastian-frysztak-master 2016-10-05 21:19:17 +02:00
Florian Bruhin
dd537c9119 Really fix test_mthml 2016-10-05 10:12:38 +02:00
Florian Bruhin
8dab1cf58a Fix test_mhtml.py 2016-10-05 09:09:42 +02:00
Sebastian Frysztak
0f84ea2339 Fix TabWidget unit test
(add show-favicons config option)
2016-10-04 16:34:52 +02: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
6b76d5defa Whitespace changes 2016-09-30 17:54:23 +02:00
Florian Bruhin
822c100f52 Make 0 a usable count for :tab-focus
Fixes #1768
2016-09-30 08:33:16 +02:00
Daniel Karbach
6728bb6430 show webview when caret testing
fixes #1988
2016-09-29 09:26:58 +02:00
Florian Bruhin
42b7d1d10f Add a colon 2016-09-29 06:35:47 +02:00
Daniel Karbach
a3bf53d0cd removed blank lines around function docstring
D201/D202
2016-09-27 16:01:25 +02:00
Daniel Karbach
fb68245f2e unit test for utils.version._path_info()
refs #1947
2016-09-27 15:36:18 +02:00
Daniel Karbach
10a1977459 adjust version unit test
to accomodate for new output from path info

refs #1947
2016-09-27 12:48:19 +02:00
Florian Bruhin
45ce430774 Fix test_check_coverage 2016-09-26 08:11:45 +02:00
Florian Bruhin
27b524300b Improve configtypes tests
This also gets configtypes.py back to 100% coverage
2016-09-26 06:33:14 +02:00
Florian Bruhin
ab7cbfdea0 Improve keyhint tests
This also brings them back to 100% coverage
2016-09-25 16:42:13 +02:00
Florian Bruhin
123aace3e8 Fix keyhint tests 2016-09-23 15:05:01 +02:00
Florian Bruhin
e04e6c51d1 Add generator argument to set_register_stylesheet 2016-09-22 17:29:03 +02:00
Florian Bruhin
750dfd98af Generalize statusbar-attached website overlays
We already had some duplicated logic for completion/keyhint/messageview,
and plan to add prompt overlays too now - so here we refactor related
code to have a list of overlays instead, which are all
resized/positioned by the mainwindow when needed.

This also changes the size management, which gets moved into the
sizeHint of the respective overlay widgets.
2016-09-22 17:04:39 +02:00
Ryan Roden-Corrent
1d2cf3b648 Completer: don't try to partition search.
Exit before trying to partition if the command prefix is not ':'.

Resolves #1969:
'TypeError with refactored completion when searching for command'
2016-09-21 07:08:34 -04:00
Florian Bruhin
49f8fa6d76 Add some tests for earlyinit.fix_harfbuzz
See #1948
2016-09-16 08:43:12 +02:00
Florian Bruhin
e5b3880b71 Check for spaces in URLs with explicit scheme
Fixes #1954
2016-09-15 22:29:21 +02:00
Florian Bruhin
d0d3245d48 Remove extra blank line 2016-09-15 17:19:53 +02:00
Florian Bruhin
04a891cbf0 Merge branch 'kwonly-default-fix' of https://github.com/Kingdread/qutebrowser into Kingdread-kwonly-default-fix 2016-09-15 17:19:26 +02:00
Florian Bruhin
9db3d3f7c3 Merge branch 'completion_tests' of https://github.com/rcorre/qutebrowser into rcorre-completion_tests 2016-09-15 16:47:32 +02:00
Florian Bruhin
018e9ef4a3 Merge branch 'completion_split' of https://github.com/rcorre/qutebrowser into rcorre-completion_split 2016-09-15 16:44:54 +02:00
Daniel Schadt
eabfdb3c16 tests: make sure the type error is the one we want 2016-09-15 16:42:02 +02:00
Florian Bruhin
37fa7431b0 Serve broken qutebrowser logo via qute:resources
This is needed when we want to display an error page after the user
requested a qute:// URL, as qute:// URLs can't access file:// content
with QtWebEngine.
2016-09-15 16:06:25 +02:00
Daniel Schadt
b6d9d3f955 fix tests for new "default required" policy
This test had a keyword only parameter without a default, which is now
disallowed. This caused the test to fail.
2016-09-15 15:46:26 +02:00
Daniel Schadt
0ef5d338bd make sure keyword-only arguments have a default
Fixes #1872.

This prevents inspect.Parameter.empty from slipping through to the
command.
2016-09-15 15:44:33 +02:00
Florian Bruhin
8bdcd49626 Fix lint 2016-09-15 15:10:55 +02:00
Florian Bruhin
44e8296a66 Remove environment variables from version()
We already have those in the report anyways.
2016-09-15 14:59:32 +02:00
Florian Bruhin
e338d4b49c Add MessageView tests 2016-09-15 14:51:22 +02:00
Florian Bruhin
7e30792bfe Fix lint 2016-09-15 14:51:22 +02:00
Florian Bruhin
fce9783570 Fix unit tests
Apart from changed parameters, messages now log even when messagemock is
used, so we needed to add a few caplog.at_level calls.
2016-09-15 14:51:22 +02:00
Florian Bruhin
a2254b671c Adjust tests/messagemock 2016-09-15 14:51:21 +02:00
Florian Bruhin
f16b96aa28 Initial implementation of new messages 2016-09-15 14:51:21 +02:00
Ryan Roden-Corrent
a7eea6a0c1 Rewrite test_on_next_prev_item after refactoring.
Check the value of the signal emitted after each one of a series of
next/prev_item calls.
2016-09-15 07:41:56 -04:00
Ryan Roden-Corrent
a9771007b1 Pass string, not index from on_selection_changed.
Simplify the CompletionWidget/Completer interface by changing
on_selection_changed to pass the newly selected text rather than the
index of the newly selected item.
This moves the logic from Completer to CompletionWidget but simplifies
the interaction between the two and makes testing easier.
2016-09-14 22:55:07 -04:00
Ryan Roden-Corrent
6646bbfe1f Test config completion with a ValueList.
The help, section, and option completion models behavee differently
with a ValueList than with a KeyValue, but previously we only tested
KeyValue.
2016-09-14 17:26:56 -04:00
Ryan Roden-Corrent
657859524f Make completion/test_models more rigorous.
It was checking that every expected item was in the actual item list,
but not visa-versa. This meant that extra completion items could show
up without failing the test.

This caught one bad test case. Bind completion includes aliases, but
the test did not expect this.
2016-09-14 17:26:56 -04:00
Florian Bruhin
5bef7dc74c Use file with known mimetype for qutescheme test 2016-09-14 16:48:49 +02:00
Florian Bruhin
3a27c45ac9 More cleanup in test_webkitqutescheme 2016-09-14 12:08:35 +02:00
Florian Bruhin
5b527d0f1e Rename test_qutescheme to test_webkitqutescheme 2016-09-14 12:07:26 +02:00
Florian Bruhin
cc1e134f25 Fix test_qutescheme.py 2016-09-14 12:05:15 +02:00
Ryan Roden-Corrent
e23d611b37 Strip quotes from completion pattern.
Given a commandline like:
`:set general editor "gvim -f"|`, the pattern should be 'gvim -f'
rather than '"gvim -f"'.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
e65aba74fd Test pattern for Completion.update_completion.
In the update_completion unit test, verify the `pattern` parameter as
well as the `model`.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
b867b87955 Don't crash Completer on unknown command.
The CommandRunner's fallback parsing behavior treated whitespace
differently than the normal flow. When a user entered an unknown
command, trailing whitespace would be stripped and the cmdline length
would be less than the cursor position.

This is fixed by making the fallback use the ShellLexer just as the
'normal' parsing does.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
52fdad8186 Test on_selection_changed with maxsplit 2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
d651cc75b0 Fix flake8/pylint errors. 2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
808a645b40 Fix quick-complete highlighting quirk.
When the commandline reads ':open |', quick-completing the only offered
completion will set the commandline to ':open some_url |'. Since `open`
has `maxsplit=0`, everything after ':open' is (correctly) treated as
one argument. This means completion is opened again with 'some url '
as the pattern (note trailing whitespace), which makes the comletion
menu 'flicker' and stay open even though it was 'supposed' to quick
compelte.

This is fixed by ignoring the next completion request if we just
completed something after maxsplit (because we don't expect any more
completions after the last split).

Resolves #1519.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
127412d91c Simplify update_completion.
Remove the class variables _cursor_part and _empty_item_index. Instead,
split up the commandline around the cursor whenever that information is
needed. Using locals instead of class variables makes the logic easier
to follow and ends up requiring much less code.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
581d7659ba Clean up Completer.on_selection_changed.
Remove the dependency on the class variables _empty_item_index
and _cursor_part to make the code easier to follow. If
_update_completion is refactored in a similar way these variables can
be removed.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
eb384fdda0 Better Completer.on_selection_changed testing.
Preparation for refactoring.
2016-09-12 22:19:44 -04:00
Florian Bruhin
e6680c3c60 Also redirect $HOME for QtWebEngine tests
See https://github.com/The-Compiler/qutebrowser/pull/1637#issuecomment-243043811
2016-09-12 19:55:31 +02:00
Florian Bruhin
b949e4d73a Start splitting DownloadModel from DownloadManager
This mostly works, apart from remove_item/remove_items not being
available on the model.
2016-09-11 14:58:07 +02:00
Florian Bruhin
4c55963dc3 Fix lint 2016-09-10 17:32:04 +02:00
Florian Bruhin
0ba74ad023 Add Qt model test for download model 2016-09-10 16:42:26 +02:00
Florian Bruhin
2df971a79c Move short_tmpdir fixture to conftest.py 2016-09-09 18:46:51 +02:00
Florian Bruhin
864ec94cde Fix lint 2016-09-09 17:56:58 +02:00
knaggita
9ff3f6810a Remove --qt-* arguments 2016-09-09 17:55:16 +02:00
Florian Bruhin
d0cf452ec8 Remove :prompt-yes and :prompt-no
Those are replaced by :prompt-accept yes and :prompt-accept no
2016-09-09 15:59:00 +02:00
Florian Bruhin
71a89bd418 *Really* fix completion with multiple words.
Turns out re.escape also escapes spaces, so we'd need to replace '(\\ )'
groups after escaping. At this point it's easier to just combine spaces
before escaping the pattern.

Fixes #1934.
Supersedes #1935.
2016-09-09 09:03:18 +02:00
Florian Bruhin
0a3853fcb7 Fix handling of spaces in completion
This is a regression introduced in
faa052ad6f.

Fixes #1934.
2016-09-08 21:59:18 +02:00
Florian Bruhin
d299fd260c Fix adblock tests 2016-09-07 18:53:11 +02:00
Florian Bruhin
f3d540b375 Fix adblock tests 2016-09-07 18:47:39 +02:00
Florian Bruhin
44d1056e54 QtWebEngine: Implement custom HTTP headers 2016-09-07 18:29:38 +02:00
Florian Bruhin
3e1583bb1c Make WebKitElement._is_visible private
It makes a lot of sense for this to be in webkitelem.py, but it should
not be public API as it's only used internally and can't be implemented
here with QtWebEngine.
2016-09-07 11:58:39 +02:00
Florian Bruhin
60c86a08c4 Get rid of WebElement.debug_text 2016-09-07 11:47:39 +02:00
Florian Bruhin
2da827462e Add a test to make sure check_coverage files exist 2016-09-07 11:37:21 +02:00
Florian Bruhin
e700d11447 Add check_vanished() in webkitelem.insert_text 2016-09-07 11:29:26 +02:00
Florian Bruhin
8f9cfcf232 Get rid of webelem.run_js_async 2016-09-07 11:27:37 +02:00
Florian Bruhin
78d64f4791 Get rid of webkitelem.focus_elem 2016-09-07 11:24:28 +02:00
Florian Bruhin
ee5a972069 Move auto-insert-mode handling to browsertab
This means auto-insert-mode now works correctly with QtWebEngine.
2016-09-07 10:24:27 +02:00
Florian Bruhin
7f013b7808 Fix lint 2016-09-06 17:00:25 +02:00
Florian Bruhin
4f55b435f0 Move various session unit tests to BDD tests 2016-09-06 13:55:28 +02:00
Florian Bruhin
f6ba859896 Move tabhistory.TabHistoryItem to misc.sessions
This makes browser.webkit.tabhistory contain only QtWebKit-specific
code.
2016-09-06 09:50:55 +02:00
Florian Bruhin
cf44019475 Don't require QtWebEngine for history tests 2016-09-05 22:25:20 +02:00
Florian Bruhin
7592345b6e Make unittests work without QtWebKit 2016-09-05 18:45:50 +02:00
Florian Bruhin
cf070d48f2 WebEngine: Disable createWindow for Qt < 5.7.1
Fixes #1911.

The bugfix is backported in my qt5-webengine-debug package, and
QUTE_QTBUG54419_PATCHED can be set to force qutebrowser to use
createWindow.
2016-09-05 15:08:00 +02:00
Florian Bruhin
1e601d3419 Add apikey to test_pastebin.py 2016-09-02 06:10:21 +02:00
arza
9b6541638e Update CHANGED_KEY_COMMANDS and test_migrations for sk-keybinding. 2016-09-01 21:05:44 +03:00
Florian Bruhin
654260dd2e Add blank line 2016-09-01 07:09:06 +02:00