Florian Bruhin
29ee605c79
Fix version output test on Windows
...
On Windows we get something like C:\IMPORTPATH instead of /IMPORTPATH
2016-07-07 18:32:13 +02:00
Florian Bruhin
674b316db3
Simplify test_version_output
2016-07-07 09:14:36 +02:00
Florian Bruhin
ebf9bc4e0a
Improve version output
2016-07-06 23:47:59 +02:00
Florian Bruhin
b429b919b5
Merge branch 'completer_tests' of https://github.com/rcorre/qutebrowser into rcorre-completer_tests
2016-07-06 13:35:13 +02:00
Florian Bruhin
70117265d6
Fix some a/an misspellings
...
Thanks to https://github.com/jwilk/anorack
2016-07-05 08:34:03 +02:00
Ryan Roden-Corrent
6c2c9438a7
More completer unit test cases.
2016-07-04 19:06:00 -04:00
Ryan Roden-Corrent
4c9417ac6e
Use helper method for cmd prompt text testing.
...
In test_completer, introduce two helper methods to reduce duplicate
code for handling fake cmd prompt text that uses '|' as a placeholder.
2016-07-04 12:31:56 -04:00
Ryan Roden-Corrent
27d635a394
Test selection_changed, not change_completed_part.
...
For the Completer unit tests:
Although `change_completed_part` looks like a public method, it was
only used internally. Test the externally-used method
`selection_changed` instead.
2016-07-04 08:22:21 -04:00
Ryan Roden-Corrent
a6a8bf9304
Clean up test_completer further.
...
Based on code review:
- Use qtbot.waitSignal to test a signal firing
- Use pytest.mark.xfail for an expected test failure
- Ensure there are 2 newlines between module-level functions
2016-07-04 07:36:31 -04:00
Ryan Roden-Corrent
68e373df44
Use QLineEdit as a base for FakeStatusbarCommand.
...
Reduces the amount of mocking and keeps it more true to the original.
2016-07-03 23:06:36 -04:00
Ryan Roden-Corrent
7f690c3f3f
More unit test coverage for Completer.
...
Test completion_item{next,prev} and change_completed_part.
2016-07-03 22:58:09 -04:00
Ryan Roden-Corrent
9bfff1c685
Test more cases for completer.update_completion.
2016-07-03 17:18:16 -04:00
Ryan Roden-Corrent
13e8ed53d6
Clean up completer unit test.
...
Based on code review:
- import modules, not classes
- use methods, not lambdas for the mock command prompt class
- use None rather than Mock for DUMB_SORT
- autouse two fixtures and remove them from test signatures
2016-07-03 17:18:16 -04:00
Jan Verbeek
8039e7ab74
Move :repeat-command tests
2016-07-03 22:32:07 +02:00
Florian Bruhin
d1f6ae99b5
tests: Skip :spawn with invalid quoting on Windows
...
For some reason this often causes segfaults lately - let's skip it until
we can investigate what's wrong.
See #1614
2016-07-03 17:32:19 +02:00
Florian Bruhin
f6cd73c784
Merge branch 'expected-error' of https://github.com/Kingdread/qutebrowser into Kingdread-expected-error
2016-07-03 16:58:06 +02:00
Ryan Roden-Corrent
07edcce697
Unit test Completer.update_completion.
...
Validate update_completion sets the completions widget's model
correctly based on the command text.
2016-07-02 12:25:55 -04:00
Daniel Schadt
ee9d3b6a49
quteprocess: replace Expected with expected
2016-07-02 17:22:40 +02:00
Daniel Schadt
4863df5ac8
quteprocess: also mark expected WARNINGs
2016-07-02 17:19:19 +02:00
Daniel Schadt
e2b521a408
fix lint
2016-07-02 16:51:58 +02:00
Daniel Schadt
bce06d6f43
quteproc: mark expected errors as such
...
Fixes #1611
This marks errors that are expected by a test with an "(Expected)"
marker and white color (instead of red).
The formatting of the log messages has been deferred to _render_log,
since the .expected attribute is not correctly set right after we read
the message.
2016-07-02 13:59:46 +02:00
Jan Verbeek
4172e39045
Move :repeat-command tests to scroll.feature
2016-07-02 01:42:47 +02:00
Florian Bruhin
3a73351779
Merge branch 'patch-2' of https://github.com/edi9999/qutebrowser into edi9999-patch-2
2016-07-01 22:53:49 +02:00
Florian Bruhin
274644e83d
tests: __tracebackhide__ in quteproc.after_test
2016-07-01 14:44:42 +02:00
Florian Bruhin
a3b0e7c1cb
Fix indent
2016-07-01 14:38:18 +02:00
Florian Bruhin
b178099f44
Merge branch 'completion_tests' of https://github.com/rcorre/qutebrowser into rcorre-completion_tests
2016-07-01 14:36:32 +02:00
Florian Bruhin
af37272246
Merge branch 'edit-url' of https://github.com/blyxxyz/qutebrowser into blyxxyz-edit-url
2016-07-01 13:40:00 +02:00
Ryan Roden-Corrent
d45acb0388
Eliminate FakeSettingSection/Value.
...
Don't really need to mock these out for tests as the real classes are
simple enough.
2016-06-30 20:12:44 -04:00
Ryan Roden-Corrent
94ec712ea8
Really clean up Qt view in completion tests.
...
Missed a spot.
2016-06-30 20:12:04 -04:00
Jan Verbeek
4f32d94f5f
Remove obsolete :edit-url with count test
2016-06-30 22:58:05 +02:00
Florian Bruhin
dece5dda78
Add a docstring for pytest_bdd_apply_tag
2016-06-30 17:42:17 +02:00
Florian Bruhin
ead437be82
Don't define pytest_bdd_apply_tag when frozen
...
This should help with the undefined hook while not requiring to install
the pytest-bdd plugin when frozen.
2016-06-30 17:40:54 +02:00
Florian Bruhin
50c1d85137
Use raw string for regex
2016-06-30 15:46:38 +02:00
Florian Bruhin
eb463ab2d3
Fix pytest-bdd tags
2016-06-30 14:47:55 +02:00
Florian Bruhin
8d9a699b5b
test requirements: Update to pytest-bdd 2.17.0
...
This also allows us to have dynamic pyqt>=5.3.1 etc. tags.
2016-06-30 14:02:30 +02:00
Ryan Roden-Corrent
4178f73ed9
Move utility functions to top of test_completion.
...
Just a style change.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
849706e310
Clean up Qt view used in completion tests.
...
Add the view created during the tests to qtot so it gets cleaned up
after the test exits.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
ee59b133c0
Don't bother mocking a history entry.
...
Use webkit.history.Entry in tests instead of FakeHistoryEntry.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
f50b8bb8e8
Use iter instead of __iter__.
...
Corrent two places this was used.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
d6012ad95c
Test delete_cur_item more cleanly.
...
Reduce duplicate code by mocking out a QTreeView around the model and
setting its index.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
9d49f5a57d
Test tab completion with multiple tabbed browsers.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
b6652ad6bc
Test completion quickmark/bookmark deletion.
...
Validate that quickmarks and bookmarks can be deleted from the url
completion menu.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
409de10fb4
Unit test delete_cur_item for tab completion model.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
8321c1a90f
Unit test setting value completion
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
f5b1019d4d
Unit test config option completion.
...
Had to add the `raw` parameter to ConfigStub.get as the setting option
completion model passes this argument explicitly (although the docs say
only raw=True is supported).
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
5255a71bc5
Unit test setting section completion.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
d49fa7c4a3
Clean up objreg after test_history.
...
test_init in test_history was leaving a web-history in the objreg,
which was interfering with the completion tests.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
16f043034f
Unit test tab (buffer) completion.
...
This involved adding a few stubs as well as expanding the FakeWebView.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
610f9b7068
Unit test session completion
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
baf8d00a20
Unit test url/quickmark/bookmark completion.
...
This also adds a few more stubs/fakes to mock out the
quickmark-manager, bookmark-manager, and web-history objects.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
b037ec489f
Add unit tests for help completion.
...
Also adds a FakeConfigSection stub for stubbing out configdata.DATA.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
555bdb75b5
Add unit test for CommandCompletionModel.
...
This establishes a pattern that can probably be used to test any of the
completion models.
See #999 .
2016-06-30 07:26:02 -04:00
Florian Bruhin
900ad1ba6d
Merge branch 'alias-multi-commands' of https://github.com/mgoral/qutebrowser into mgoral-alias-multi-commands
2016-06-30 12:34:18 +02:00
Florian Bruhin
99d921f169
Merge branch 'scroll' of https://github.com/blyxxyz/qutebrowser into blyxxyz-scroll
2016-06-30 12:18:15 +02:00
Jan Verbeek
320b9cac3f
Move repeat-command, make it work with multiple modes, improve tests
2016-06-30 02:22:02 +02:00
Florian Bruhin
03fbacd93c
requirements: Update vulture to 0.9
...
* Don't flag attributes as unused if they are used as global variables in
another module.
* Don't consider "True" and "False" variable names.
* Abort with error message when invoked on .pyc files.
This means we can remove the whitelisted globals in run_vulture.py and
the associated xfailing test.
We also needed to adjust run_vulture.py slightly as the file attribute
got renamed to filename.
2016-06-29 23:44:39 +02:00
Jan Verbeek
cc1899ebca
Add tests for repeat-command, make compatible with different count methods
2016-06-29 20:29:56 +02:00
Jan Verbeek
3c2c7ecaae
Test for scroll with count and argument
2016-06-29 11:47:51 +02:00
Patric Schmitz
217b912f3c
revert custom exception throwing in savefile_open
...
instead adapt test_failing_flush to catch correct exception (ValueError).
2016-06-28 15:03:23 +02:00
Patric Schmitz
a33978ee89
fix error handling in savefile_open and tests
2016-06-28 12:59:00 +02:00
Edgar Hipp
81c69421c5
Update test_readline.py
2016-06-24 12:00:53 +02:00
Florian Bruhin
8eee3f6bce
Add a test for zooming in cloned tab
2016-06-15 14:44:01 +02:00
Ryan Roden-Corrent
9578a3324e
Break two long lines that were failing pylint.
2016-06-13 22:31:21 -04:00
Michał Góral
9b394e4111
Use config_stub instead of monkeypatching config.get()
2016-06-13 19:39:00 +02:00
Florian Bruhin
4fccc89d7d
Split browser into browser/browser.webkit
2016-06-13 11:18:21 +02:00
Florian Bruhin
f70a75978b
Move browser.network.pastebin to misc
2016-06-13 09:48:53 +02:00
Michał Góral
4b883c089e
Fixed linters.
2016-06-12 23:04:14 +02:00
Michał Góral
370c8a8b07
Created tests for reading aliases.
2016-06-12 22:31:10 +02:00
Michał Góral
7ee99ba043
Moved searching for aliases to CommandRunner.parse_all()
...
This addresses issue with having alias for multiple commands splitted by ';;'.
See: The-Compiler/qutebrowser#956 .
2016-06-12 21:09:10 +02:00
Daryl Finlay
054e9ab439
Add host placeholder to window and tab title formats
2016-06-10 21:59:43 +01:00
Florian Bruhin
acf54c5cbe
Release v0.7.0
2016-06-10 15:18:56 +02:00
Florian Bruhin
a95b8eed9b
tests: Add config for v0.7.0
2016-06-10 15:14:22 +02:00
Florian Bruhin
0b4f4a7f23
Improve manual history test
2016-06-10 14:41:08 +02:00
Florian Bruhin
66938ed44b
Full redirect support for history
...
When a redirect occurs, the item is saved in history with a -r suffix
now. When opening qutebrowser that's picked up and the item is hidden
from completion.
2016-06-10 14:40:42 +02:00
Florian Bruhin
e0acda403f
Add an end-to-end test for :history-clear
2016-06-10 13:20:58 +02:00
Florian Bruhin
0a25bb508a
Fix lint
2016-06-10 12:21:48 +02:00
Florian Bruhin
9298fa697b
Allow to pass atime to WebHistory.add_url
...
This makes a lot of tests easier and/or more exact.
2016-06-10 12:12:29 +02:00
Florian Bruhin
7511bc1fe5
tests: 100% coverage for browser.history
2016-06-10 12:01:14 +02:00
Florian Bruhin
14a04f1535
Fix lint
2016-06-09 22:03:35 +02:00
Florian Bruhin
185b4bc18b
Add more tests for browser.history
2016-06-09 21:14:04 +02:00
Florian Bruhin
d3dd6d2f77
Add hypothesis test for history.Entry.from_str
2016-06-09 21:14:04 +02:00
Florian Bruhin
33f01d8375
Fix lint
2016-06-09 21:14:03 +02:00
Florian Bruhin
9510af9912
Use QUrl with QWebHistory
...
Now that we have our own history implementation, we get the URLs as QUrl
and not as string - so no point in converting them to string and back.
2016-06-09 21:14:03 +02:00
Florian Bruhin
5f25ce69ec
Add some tests for browser.history
2016-06-09 21:14:03 +02:00
Florian Bruhin
789b9c9308
tests: Yield fake_save_manager from fixture
2016-06-09 17:44:04 +02:00
Florian Bruhin
75669dd21b
tests: Move fake_save_manager to helper.fixtures
2016-06-09 17:44:04 +02:00
Florian Bruhin
ef2b3cd6d9
tests.helpers: Clean up imports
2016-06-09 17:44:04 +02:00
Florian Bruhin
346e59880e
Add a manual test for visited history
2016-06-09 17:44:04 +02:00
Florian Bruhin
089131c79d
Improve error message when clicking invalid link
2016-06-09 17:43:33 +02:00
Florian Bruhin
86632804a9
behaviour -> behavior for consistency
2016-06-09 17:30:14 +02:00
Florian Bruhin
726ae50251
Clean up find-implementation in test_hints_html
2016-06-09 17:16:00 +02:00
Florian Bruhin
dbbc4b72ed
Use quteproc.set_setting in test_hints_html
2016-06-09 17:15:34 +02:00
Florian Bruhin
ab8a2f7147
Fix lint
2016-06-09 17:12:23 +02:00
Florian Bruhin
035526848e
Add a hints -> find-implementation setting
...
This makes it possible to switch to an alternative implementation if
there are weird issues like #1568 . Some users might also prefer the
slightly better performance over more accurate hints.
2016-06-09 17:00:08 +02:00
Florian Bruhin
2d54c927e3
Fix urlutils tests on Qt 5.6.1
...
For some reason the behaviour of QHostAddress("31c3").isValid() changed
with Qt 5.6.1: https://bugreports.qt.io/browse/QTBUG-53983
This causes the test to fail because Qt thinks this is a valid IP, so we
think it's a valid URL.
2016-06-09 15:16:49 +02:00
Florian Bruhin
9e1d20017c
tests: Mark "History with an error" as flaky
...
For some reason, sometimes on Travis the history file we read is empty.
I have no idea why though, as we successfully wait until ":save saved
history" is logged, and that is working fine.
Let's just mark the test as flaky for now so we can move on.
2016-06-09 11:17:18 +02:00
Florian Bruhin
288744c8d0
Use BDD test for link with spaces issue
...
Clicking actually works fine without the strip() as _resolve_url is
never called in that case, so we need to do something which actually
needs the URL as well.
2016-06-09 10:50:08 +02:00
Florian Bruhin
281d2a427b
Merge branch 'stripurl' of https://github.com/Konubinix/qutebrowser into Konubinix-stripurl
2016-06-09 10:38:35 +02:00
Florian Bruhin
aae205030c
Add missing import
2016-06-09 10:29:16 +02:00
Florian Bruhin
d6926f0622
Fix expected data in AppendLineParser test
...
There were two different issues here:
- `\n` rather than `os.linesep` was used, which caused the "generated"
file to have less data in it than expected
- A final `os.linesep` (or `\n`) was missing, but that was cancelled out
by a off-by-one error when slicing, so wasn't an issue until we tried
with \r\n endings.
2016-06-09 10:26:09 +02:00
Samuel Loury
a69610077e
Add a test about a href with spaces around
2016-06-09 08:36:18 +02:00
Florian Bruhin
4fe6935003
Merge branch 'lowercase-toggle' of https://github.com/EliteTK/qutebrowser into EliteTK-lowercase-toggle
2016-06-08 22:39:19 +02:00
Florian Bruhin
01a622bf02
history tests: Sync with :save better
2016-06-08 22:32:39 +02:00
Florian Bruhin
d40e8e1c2f
tests: Set auto-save-interval to 0
...
Otherwise history tests could fail because waiting for
"Saved to *history" waited for a previous line, not the newest one.
It also doesn't make any sense to save stuff anyways.
2016-06-08 21:54:44 +02:00
Tomasz Kramkowski
a98cd9a528
Change relevant tests to work with new toggle behaviour
2016-06-08 19:37:13 +01:00
Florian Bruhin
e08c6cb059
Don't save the original URL for redirected pages
...
See #1345
2016-06-08 17:15:08 +02:00
Florian Bruhin
483a5f8103
Fix sharing of cookie jars with private browsing
...
Fixes #1219
2016-06-08 16:35:43 +02:00
Florian Bruhin
b6e534f9b8
Add BDD tests for new history code
2016-06-08 15:15:54 +02:00
Florian Bruhin
8c9bd95123
test webserver: Whitelist some more HTTP statuses
...
- HTTP 301 for redirect-to
- HTTP 404 for status/404
2016-06-08 15:15:54 +02:00
Florian Bruhin
a870a2888f
Improve LineParser clear tests
2016-06-08 11:33:37 +02:00
Florian Bruhin
44f626134b
Use real files for lineparser tests
2016-06-08 11:33:37 +02:00
Florian Bruhin
1d51d63f0c
LineParser tests: Clear self._data in _open
2016-06-08 10:36:46 +02:00
Florian Bruhin
b09fe8dca0
Document LineParserMixin attributes
2016-06-08 10:22:55 +02:00
Florian Bruhin
33bcced4a2
Add a test for AppendLineParser.clear
2016-06-08 10:11:59 +02:00
Florian Bruhin
cca26f0f13
Fix lint
2016-06-08 09:45:05 +02:00
Florian Bruhin
1104a731a5
Fix filtering of all hints in number mode
...
Fixes #1559
2016-06-07 18:34:46 +02:00
Florian Bruhin
db0a67766d
Ignore hints -> scatter for number hints
...
See https://github.com/The-Compiler/qutebrowser/issues/308#issuecomment-167091450
2016-06-07 15:13:30 +02:00
Florian Bruhin
ca88b7a1cf
Add test for multi-word matching
2016-06-07 14:24:53 +02:00
Florian Bruhin
d3eec49b6e
Add automated test for #1186
2016-06-07 14:15:32 +02:00
Florian Bruhin
8ff53fdb7f
Add an automated test for #576
...
This is now testable easily since hints are renumbered
2016-06-07 14:08:25 +02:00
Florian Bruhin
efddd64d56
Add test for #308
2016-06-07 13:52:17 +02:00
Florian Bruhin
335c6783ce
Add a manual test page for #576
2016-06-07 11:57:01 +02:00
Florian Bruhin
01c4c1717f
Add manual test file for #1186
2016-06-07 11:55:17 +02:00
Florian Bruhin
82d7c33b29
Add tests for hints -> auto-follow-timeout
2016-06-07 11:06:39 +02:00
Florian Bruhin
bdef8c4e3a
Fix lint
2016-06-07 08:23:35 +02:00
Florian Bruhin
e8123bb68a
Fix pdfjs version parsing for never versions
2016-06-07 07:42:34 +02:00
Florian Bruhin
fd8286d4eb
Fix BDD runtest_makereport hook on non-BDD tests
2016-06-06 23:37:26 +02:00
Florian Bruhin
b635d10836
Merge branch 'iframe_tests' of https://github.com/lahwaacz/qutebrowser into lahwaacz-iframe_tests
2016-06-06 23:32:20 +02:00
Florian Bruhin
a9f27e3247
bdd: Turn off colors with --color=no
2016-06-06 23:19:14 +02:00
Florian Bruhin
b0df87842e
Show BDD scenario on failed tests
...
See #1552
2016-06-06 23:09:19 +02:00
Florian Bruhin
d2b1682915
Add #1514 to tests/manual/hints/other.html
2016-06-06 21:24:02 +02:00
Jakub Klinkovský
b1997c1e00
tests: add missing wait in "Scenario: Opening a link with specific target frame in a new tab"
2016-06-06 18:26:04 +02:00
Jakub Klinkovský
199f0aeb76
tests: un-xfail some iframe tests ( #1525 )
...
The given reason (clicking an iframe to get a focus) applies to only one
test, the others are either stable or flaky for a different reason.
2016-06-06 17:34:22 +02:00
Florian Bruhin
d91f4e13d0
Fix long line
2016-06-06 17:13:56 +02:00
Florian Bruhin
520572321a
Add unittests for partial command parsing
2016-06-06 16:18:49 +02:00
Florian Bruhin
c9d85d3a12
bdd: Add tests for partial commandline matching
2016-06-06 16:10:10 +02:00
Florian Bruhin
2f60073cdf
bdd: Allow to run invalid commands via quteproc
2016-06-06 16:10:01 +02:00
Florian Bruhin
4e86a888c9
Add webelem tests for JS/non-JS rect_on_view
2016-06-06 15:42:30 +02:00
Florian Bruhin
abfd789f9e
Fix zooming with a too big count
...
Fixes #1118
Supersedes #1140
2016-06-06 13:25:01 +02:00
Florian Bruhin
8d5fdf2833
Remove wrap mode for NeighborList
2016-06-06 13:10:14 +02:00
Florian Bruhin
45da93ab55
Update manual hint tests
2016-06-06 12:12:23 +02:00
Florian Bruhin
10630e30ab
hints: Integrate _get_first_rectangle into webelem
2016-06-06 11:56:15 +02:00
Florian Bruhin
b262580b22
Fix hint position when zoom is used
2016-06-06 10:41:59 +02:00
Florian Bruhin
0e4dbd646c
Merge branch 'hints_positioning' of https://github.com/lahwaacz/qutebrowser into lahwaacz-hints_positioning
2016-06-06 10:22:06 +02:00
Florian Bruhin
7db9b85d31
Add entry for exherbo.org to manual/hints/other
2016-06-06 09:17:25 +02:00
Florian Bruhin
164be08627
Rename shadowed function
2016-06-06 09:06:49 +02:00
Florian Bruhin
23bcc35ebd
Add some manual test pages for hints
2016-06-06 09:04:35 +02:00
Florian Bruhin
dce969997a
Reorganize tests/html
2016-06-06 08:38:35 +02:00
Florian Bruhin
3cfb430cdf
bdd: Add test for spawning an external editor
2016-06-06 08:36:30 +02:00
Florian Bruhin
9f3c2dfada
Merge branch 'bind_case_fix' of https://github.com/rcorre/qutebrowser into rcorre-bind_case_fix
2016-06-04 23:30:50 +02:00
Florian Bruhin
7b852a7bbb
Merge branch 'rapid_normal_hints' of https://github.com/rcorre/qutebrowser into rcorre-rapid_normal_hints
2016-06-04 23:11:54 +02:00
Florian Bruhin
5c329c409c
Improve error messages in test_hints
...
See #1542
2016-06-04 23:09:08 +02:00
Florian Bruhin
831c3c0272
Add a README for tests/end2end/data/hints/html
...
See #1542
2016-06-04 23:08:59 +02:00
Florian Bruhin
dc6113dcfa
Make scroll test page a bit wider
...
See #1542
2016-06-04 22:53:37 +02:00
Ryan Roden-Corrent
68faf2b873
Allow hint --rapid in normal mode.
...
This was disallowed by an assertion, but has a legitimate use case for
clicking multiple buttons or ticking multiple checkboxes.
Resolves #1541 .
2016-06-04 15:32:58 -04:00
Ryan Roden-Corrent
1dc20f4d02
Handle special keystrings case-insensitively.
...
Load all special keystrings (e.g. <ctrl-a>) into memory as lowercase,
and automatically lowercase any special keystring given to bind/unbind.
This prevents <ctrl-a> and <Ctrl-A> from being treated differently.
Resolves #816 .
Also resolves #1544 (dupe).
2016-06-04 07:39:09 -04:00
Florian Bruhin
163082b3ea
Wait until download is started
2016-06-04 13:15:22 +02:00
Daniel Schadt
fd27caf311
tests: remove wait in mhtml cancel test
2016-06-03 16:09:31 +02:00
Daniel Schadt
c3e7ab52b5
tests: add test for cancelling a mhtml download
2016-06-02 23:07:03 +02:00
Florian Bruhin
fcba6beecf
Merge branch 'json-logging' of https://github.com/Kingdread/qutebrowser into Kingdread-json-logging
2016-06-01 13:07:52 +02:00
Florian Bruhin
3e5994cff6
bdd: Get rid of "I execute the userscript" step
...
Since we now have a (testdata) substitution this is much easier.
2016-05-30 16:21:32 +02:00
Florian Bruhin
c17a1be8fd
Add a test for flags passed to a command
2016-05-30 16:18:03 +02:00
Florian Bruhin
0aa7ed2eb3
Move userscript to correct place
2016-05-30 16:10:52 +02:00
Florian Bruhin
a39c662633
Merge branch 'hint_spawn_fix' of https://github.com/rcorre/qutebrowser into rcorre-hint_spawn_fix
2016-05-30 16:09:28 +02:00
Daniel Schadt
a6b47a7c09
fix lint
2016-05-30 16:00:10 +02:00
Daniel Schadt
fa2636c2f6
tests: fix timezone issues for test_quteprocess
...
Depending on the timezone, you may either get 00:00 as time or 01:00,
which is bad for testing on different machines.
2016-05-30 16:00:10 +02:00
Daniel Schadt
65e5a3fe09
quteproc: match message with re.DOTALL
...
Since they may now contain newlines, we need to get the whole message,
which are otherwise not included in .
2016-05-30 16:00:10 +02:00
Daniel Schadt
f676a599a2
tests: remove leftover lines from writing the code
...
Those lines are not needed.
2016-05-30 16:00:10 +02:00
Daniel Schadt
484320ac19
quteproc: see lines starting with ' ' as error
...
Now that json logging is used, multiple lines should be correctly
escaped (and parsed), even in tracebacks, so this check should now be
obsolete.
2016-05-30 16:00:10 +02:00
Daniel Schadt
db240e294e
quteproc: delegate LogLine to log.ColoredFormatter
2016-05-30 16:00:10 +02:00
Daniel Schadt
cc7c477e3e
tests: add update tests for LogLine with json logs
2016-05-30 16:00:10 +02:00
Daniel Schadt
6a6f396f85
quteproc: set lineno to None if function is None
2016-05-30 16:00:10 +02:00
Daniel Schadt
cea32ea333
log: embed traceback in json object
2016-05-30 16:00:10 +02:00
Daniel Schadt
96b299a1fc
quteproc: Nicer output for unexpected errors
...
Instead of
LogLine('{"levelname": "ERROR", ...}')
we get
21:22:34 ERROR downloads mhtml ...
2016-05-30 16:00:10 +02:00
Daniel Schadt
b4022b9795
quteproc: fix log_color in log message
...
This actually uses the escape code, not just the color name.
2016-05-30 16:00:10 +02:00
Daniel Schadt
ae16240d41
quteproc: fix docstring in formatted_str
...
Autocomplete was faster and inserted .strip() after line
2016-05-30 16:00:10 +02:00
Daniel Schadt
d4a295b22e
tests: update test_log with json_logging namespace
2016-05-30 16:00:10 +02:00
Daniel Schadt
cf3930f925
quteproc: except ValueError
...
There is no json.decoder.JSONDecodeError, it was a lie all along...
2016-05-30 16:00:10 +02:00
Daniel Schadt
49419bc429
tests: update test_invocations for --json-logging
2016-05-30 16:00:10 +02:00
Daniel Schadt
4a59a1f112
log: implement JSON as logging output
...
Fixes #1501
Enabled via the --json-logging parameter.
2016-05-30 16:00:10 +02:00
Florian Bruhin
9a0fa9068c
Stabilize tests using :follow-hint
2016-05-30 14:54:06 +02:00
Florian Bruhin
6741a16957
Stabilize :buffer tests
...
Fixes #1493
2016-05-30 01:16:44 +02:00
Florian Bruhin
402e110cab
bdd: Delete "Navigating up with root directory"
...
This test causes various trouble for reasons I don't understand, so
let's get rid of it.
2016-05-29 23:59:28 +02:00
Florian Bruhin
d385206ea0
tests: Set some settings for quteproc
...
We set ui -> message-timeout to 0 to get better error messages in the
log output and network -> ssl-strict to not hang on unexpected SSL
errors.
2016-05-29 23:40:09 +02:00
Florian Bruhin
08f5cfd366
Fix test_enter_folder on Windows
2016-05-29 22:46:32 +02:00
Florian Bruhin
86be7ad82c
Move file_url from utils.jinja to utils.urlutils
2016-05-29 22:44:40 +02:00
Florian Bruhin
8e2d315807
Fix pytest_status workaround if .cache is missing
2016-05-29 22:21:35 +02:00
Florian Bruhin
2d9cf5ed3a
Handle invalid URLs in wait_for_load_finished_url
2016-05-29 22:16:55 +02:00
Florian Bruhin
001670969b
tests: Ignore segfaults on pytest exit
...
In various situations (especially on OS X), pytest segfaults on exit probably
due to Qt/PyQt bugs.
We now have a wrapper script which ignores those segfaults if pytest did run
successfully.
2016-05-29 22:06:24 +02:00
Florian Bruhin
119d76c502
Fix lint
2016-05-29 18:45:09 +02:00
Florian Bruhin
5b84fc93df
Do a final userscript command read on cleanup
...
On OS X, sometimes the userscript exited before the QSocketNotifier was
triggered. By doing a final read when cleaning up we make sure we don't
miss anything.
Fixes #1533 .
2016-05-29 18:42:56 +02:00
Florian Bruhin
e10e9c7df2
bdd: Don't run :spawn -u test on OS X for now
...
See #1533
2016-05-29 18:25:23 +02:00
Florian Bruhin
a905d46757
bdd: Merge userscripts.feature into spawn.feature
2016-05-29 18:24:34 +02:00
Florian Bruhin
64d4c9f83e
Clean up end2end test file structure
...
This renames tests/integration to tests/end2end and moves some files to
tests/end2end/fixtures.
2016-05-29 18:20:00 +02:00
Florian Bruhin
a3a160cb22
tests: Fix race condition in test_enter_folder
2016-05-29 17:48:02 +02:00
Florian Bruhin
867b4a8640
Make quteproc.wait_for_load_finished_url public
2016-05-29 17:47:39 +02:00
Florian Bruhin
e7a6907bc2
tests: Don't run geolocation tests on OS X
...
We already only run them on CI because they can be kind of
unpredictable, and it seems OS X on Travis hangs when running them too.
2016-05-29 17:35:43 +02:00
Florian Bruhin
bceb7cf89e
tests: Avoid race conditions for :messages tests
...
We need to wait until the page is actually loaded before we check the
content.
2016-05-29 17:07:37 +02:00
Florian Bruhin
d3fe2babd3
tests: Wait until page is loaded by default
...
When doing quteproc.open_path, by default the test didn't wait until the page
was loaded. This caused unintentional race conditions which e.g. caused
dirbrowser tests to fail on OS X:
https://travis-ci.org/The-Compiler/qutebrowser/jobs/133730001
Now instead we wait by default, unless wait=False is passed to open_path() or
open_url().
2016-05-29 16:14:33 +02:00
Florian Bruhin
b97736b117
Revert "Work around flake8-string-format bug"
...
This reverts commit 6c4beef783
.
2016-05-29 14:17:32 +02:00
Florian Bruhin
1e55db0630
Follow the American way(tm) of spelling things
2016-05-29 10:57:41 +02:00
Florian Bruhin
6caa89a622
Merge branch 'empty_uri' of https://github.com/hcraT/qutebrowser into hcraT-empty_uri
2016-05-29 00:37:12 +02:00
Tarcisio Fedrizzi
ec2935fab0
Fixes flake8 error
2016-05-28 17:38:31 +02:00
Florian Bruhin
1d87eee4d7
Fix starting when sys.stderr is None
2016-05-27 14:48:46 +02:00
Florian Bruhin
afcb018ee2
Fix some spelling mistakes
...
Found via http://jwilk.net/software/mwic
2016-05-27 12:07:00 +02:00
Florian Bruhin
2fb5de8bd3
test_insert_mode: Always set fake clipboard
...
Otherwise if we only run a keypress test, the fake clipboard won't be
activated and thus the subsequent :yank-selected would write to the real
clipboard.
2016-05-27 00:12:53 +02:00
Florian Bruhin
6c4beef783
Work around flake8-string-format bug
...
When using flake8-string-format on Python 3.5 with str.format(*group) it
failed:
Traceback (most recent call last):
File "./.venv-flakes/bin/flake8", line 11, in <module>
sys.exit(main())
File ".../site-packages/flake8/main.py", line 33, in main
report = flake8_style.check_files()
File ".../site-packages/flake8/engine.py", line 181, in check_files
return self._retry_serial(self._styleguide.check_files, paths=paths)
File ".../site-packages/flake8/engine.py", line 172, in _retry_serial
return func(*args, **kwargs)
File ".../site-packages/pep8.py", line 1842, in check_files
runner(path)
File ".../site-packages/flake8/engine.py", line 126, in input_file
return fchecker.check_all(expected=expected, line_offset=line_offset)
File ".../site-packages/pep8.py", line 1574, in check_all
self.check_ast()
File ".../site-packages/pep8.py", line 1521, in check_ast
for lineno, offset, text, check in checker.run():
File ".../site-packages/flake8_string_format.py", line 288, in run
assert isinstance(call.args, ast.Starred) is bool(has_starargs)
AssertionError
This works around that issue.
See https://github.com/xZise/flake8-string-format/issues/11
2016-05-26 23:50:58 +02:00
Tarcisio Fedrizzi
a3e6761db6
Fixes pylint error
2016-05-26 18:01:01 +02:00
Tarcisio Fedrizzi
a9e96df5df
Adds unit test when force_search is True
2016-05-26 18:01:01 +02:00
Tarcisio Fedrizzi
462f9d7e4c
Refators discussed in the review
...
- refactors what discussed in the review
- adds unit tests for schemas without host and path
2016-05-26 18:01:01 +02:00
Ryan Roden-Corrent
db09cbb960
Implement a feature test for :hint all userscript.
...
This adds a (testdata) substitution for 'When I run {command}' to allow
providing an absolute path for the userscript.
2016-05-26 07:35:28 -04:00
Nick Ginther
1ea99c5958
add completing single option argument test
2016-05-25 17:52:36 -05:00
Florian Bruhin
c96722f169
Merge branch 'better_keyhints' of https://github.com/rcorre/qutebrowser into rcorre-better_keyhints
2016-05-25 22:04:51 +02:00
Tarcisio Fedrizzi
73c200fb14
Tweaks the multi-line heuristic to handle scheme-like text
...
Adds some options to implement a way to treat multiline text that starts
with a scheme-like line as text instead as an URL.
2016-05-25 08:05:57 +02:00
Ryan Roden-Corrent
f58e2d91dc
Add a keyhint blacklist.
...
Replace the setting ui.show-keyhints with ui.keyhint-blacklist, which
is a list of globs for keychains that shouldn't be hinted. This allows
users to prevent showing keyhints for keychains they already know.
keyhint-blacklist='*' is equivalent to show-keyhints=False.
Resolves #1515 .
2016-05-24 20:46:39 -04:00
Florian Bruhin
f100eb6e03
Mark iframe hint tests as xfail_norun as a stopgap
...
See #1525 .
2016-05-24 22:23:42 +02:00
Florian Bruhin
3bbc950616
Fix lint
2016-05-24 21:53:50 +02:00
Florian Bruhin
846fe8b943
Add a test for #1484
2016-05-24 21:36:09 +02:00
Ryan Roden-Corrent
b1aaf0f10f
Only show keyhints after a short delay.
...
If a user knows the keychain and can type it quickly, we shouldn't
annoy them with a popup. Only show the keyhint if the user doesn't
complete their keychain in 500ms.
The isVisible() check in the tests is somewhat invalid now because it
is never immediately visible and I don't want to add a delay to unit
tests. I added a check that text() is not set for one test that was
only checking isVisible().
Addresses part of #1515 .
2016-05-23 21:21:03 -04:00
Jakub Klinkovský
ee8247525e
simplify testcase for following a hint inside an iframe
2016-05-22 15:19:00 +02:00
Ryan Roden-Corrent
648f89ef31
Implement more tests for the hinting.
...
Validate the hint spawn fix as well as add feature tests for previously
untested hinting behaviors (fill, run, --rapid).
There is still no test for the 'userscript' target as running a
userscript from hint mode during a test does not get the same
redirection as the 'I execute the userscript ...' statement, That is,
it looks in /usr/local/share/qutebrowser/userscripts rather than
tests/integration/data/userscripts.
2016-05-21 07:48:52 -04:00
Ryan Roden-Corrent
87cb5bf6c2
Fix test html link for hints
2016-05-20 22:13:49 -04:00
Ryan Roden-Corrent
f025394e04
Set maxsplit=2 for :hint.
...
This supports things like :hint all spawn -v echo as '-v echo' will be
passed as a single unit to spawn rather than -v being interpreted as a
flag for :hint.
Resolves #797 .
Note that, while `:hint --rapid all spawn -v` echo works,
`:hint all --rapid spawn -v echo` does not (this did not work before
either).
2016-05-20 22:11:58 -04:00
Ryan Roden-Corrent
0300f03ebc
Allow passing args to spawn from :hint.
...
Instead of creating a new guiprocess manually, just pass the args along
to the spawn command so it can accept args like -v.
Addresses part of #797 by allowing `hint -- all spawn -v echo`.
`hint all spawn -v echo` is still not supported.
2016-05-20 22:11:58 -04:00
Florian Bruhin
a5c08e23b6
Fix path to link.html in new tests
2016-05-20 17:21:05 +02:00
Florian Bruhin
ea1f46d542
Merge branch 'hints_clicking' of https://github.com/lahwaacz/qutebrowser into lahwaacz-hints_clicking
2016-05-20 17:09:16 +02:00
Florian Bruhin
107934e4e1
bdd: Wait a bit in "No crash should happen" step
...
If we don't do this, the qutebrowser process will be terminated and exit
before it actually has a chance to crash.
See #1510
2016-05-20 16:03:52 +02:00
Florian Bruhin
b934f8bc4e
Fix lint
2016-05-20 13:07:36 +02:00
Ryan Roden-Corrent
b1440a1804
Implement utils.is_special_key.
...
The check `key.startswith('<') and key.endswith('>') is repeated many
times in code to check for a special key. Replace all these with a call
to the same function.
2016-05-19 20:48:48 -04:00
Ryan Roden-Corrent
5992b81850
Don't show keyhint if there are no hints.
...
Currently, the keyhint window is shown even if the keystring matches no
possible bindings. This causes an empty keyhint window to hang around
after entering hinting mode.
Instead, the window is now hidden if no bindings match the current
keystring.
Resolves #1507 .
2016-05-19 07:02:23 -04:00
Stefan Tatschner
2c7dc6ffcc
Add invalid url to 'test_set_hover_url_encoded'
...
This covers the recently introduced code path, in 1c23815
(Fix crash
when hovering over an invalid URL, 2016-05-18) when hovering an
invalid URL.
2016-05-18 22:23:26 +02:00
Florian Bruhin
d0af80fbd5
Merge branch 'keystring' of https://github.com/rcorre/qutebrowser into rcorre-keystring
2016-05-18 07:33:17 +02:00
Florian Bruhin
324fcfadb0
Merge branch 'hint_inputs' of https://github.com/Liambeguin/qutebrowser into Liambeguin-hint_inputs
2016-05-18 07:30:46 +02:00
Florian Bruhin
02cbc2f986
Merge branch 'pretty-hover-url' of https://github.com/forkbong/qutebrowser into forkbong-pretty-hover-url
2016-05-18 07:27:30 +02:00
Florian Bruhin
e4d84b0bfc
Simplify argparser.type_check
...
If the value isn't param.default, it will always be a string or a flag, as
type_conv never gets called when the function is called from Python.
2016-05-18 07:16:17 +02:00
Florian Bruhin
a83bf9c3ee
Simplify argparser.type_conv
...
Since we're not using those functions as argparse callbacks anymore, we
can write a normal function instead of factories, which simplifies
things a lot.
2016-05-18 06:55:27 +02:00
Florian Bruhin
c0d044447d
Add tests for qutebrowser.utils.typing
2016-05-18 06:55:17 +02:00
Florian Bruhin
6ed9b6b13f
Make sure typing.Union[str, int] gets handled
...
str always needs to be the last element checked as otherwise it'd always
win.
2016-05-18 06:55:17 +02:00
Florian Bruhin
a0d0b6464f
Use typing.py-like annotations for command args
...
This means:
- An annotation like (int, str) is now typing.Union[int, str].
- utils.typing got expanded so it acts like the real typing.py, with
issubclass() working properly with typing.Union and __union_params__
being set.
- A literal string doesn't exist anymore as annotation, instead
@cmdutils.argument now has a 'choices' argument which can be used like
@cmdutils.argument('arg', choices=['val1', 'val2']).
- Argument validating/converting is now entirely handled by
argparser.type_conv instead of relying on python's argparse, i.e.
type/choices is now not passed to argparse anymore.
2016-05-18 06:55:17 +02:00
Florian Bruhin
3a33bc42a6
Add initial support for the typing module
2016-05-18 06:55:17 +02:00
Florian Bruhin
9694374673
Add test for cmd arg types
2016-05-18 06:55:17 +02:00
Florian Bruhin
c33f0c3512
Use @cmdutils.argument for completions
2016-05-18 06:55:17 +02:00
Florian Bruhin
3ab40bbc23
Clear globals correctly for all cmdutils tests
...
TestArgument didn't clear the globals as the fixture was inside
TestRegister.
This means test_run_vulture failed in funny ways because run_vulture.py
generated a whitelist containing "<locals>" for commands:
tests/unit/scripts/test_run_vulture.py:55: in run
return run_vulture.run([str(e.basename) for e in files])
scripts/dev/run_vulture.py:146: in run
vult.scavenge(files + [whitelist_file.name])
.tox/py35/lib/python3.5/site-packages/vulture.py:107: in scavenge
self.scan(module_string)
.tox/py35/lib/python3.5/site-packages/vulture.py:75: in scan
node = ast.parse(node_string, filename=self.file)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
source = 'qutebrowser.browser.commands.CommandDispatcher.buffer\nqutebrowser.misc.savemanager.SaveManager.save_command\nqutebro...iidoc.UsageFormatter._get_default_metavar_for_positional\nscripts.dev.src2asciidoc.UsageFormatter._metavar_formatter\n'
filename = '/tmp/tmp_ein2umn', mode = 'exec'
def parse(source, filename='<unknown>', mode='exec'):
"""
Parse the source into an AST node.
Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
"""
> return compile(source, filename, mode, PyCF_ONLY_AST)
E File "/tmp/tmp_ein2umn", line 16
E test_cmdutils.TestArgument.test_wrong_order.<locals>.fun
E ^
E SyntaxError: invalid syntax
2016-05-18 06:55:17 +02:00
Florian Bruhin
c14db202d6
Use @cmdutils.argument to hide arguments
2016-05-18 06:55:17 +02:00
Florian Bruhin
2370793f38
Make win_id/count mutually exclusive for ArgInfo
2016-05-18 06:55:17 +02:00
Florian Bruhin
35135c4b0d
Use @cmdutils.argument for win_id/count
2016-05-18 06:55:17 +02:00
Florian Bruhin
04367851c3
Refactor how cmdutils.ArgInfo works
...
It's now a real class, and some other aspects about how it's handled
were cleaned up as well.
2016-05-18 06:55:17 +02:00
Florian Bruhin
9eeaeb95c3
Make sure @cmdutils.argument after @register fails
2016-05-18 06:55:17 +02:00
Florian Bruhin
3c586f34ff
Add a @cmdutils.argument decorator
...
For now the only available keyword argument is 'flag' which customizes
the flag an argument will get.
See #637 .
2016-05-18 06:55:17 +02:00
Florian Bruhin
ee579b4bc3
Add a script to strip trailing whitespace
...
Obsoletes #1498
2016-05-18 06:37:26 +02:00