Commit Graph

278 Commits

Author SHA1 Message Date
Jonas Schürmann
45c9768c16 Added --target command line argument #922
This argument is used to override the new-instance-open-target config
option.
2015-10-05 21:15:52 +02:00
Florian Bruhin
cabbe406e3 tests: Fix ignoring of "load glyph failed" message.
The mark seems to be swallowed somehow when it's after @hypothesis.given.

See https://github.com/DRMacIver/hypothesis/issues/189
2015-10-05 08:11:26 +02:00
Florian Bruhin
f4fdcbdd71 Add a --check-all to check_coverage.py. 2015-10-04 20:35:24 +02:00
Florian Bruhin
54ae1582af Make check_coverage work when called with a file. 2015-10-04 19:36:26 +02:00
Florian Bruhin
55efd1358b Work around coverage.py bug in test_check_coverage.
Fixes #981.
See https://bitbucket.org/ned/coveragepy/issues/422/
2015-10-04 18:33:37 +02:00
Florian Bruhin
de49e5f0a5 Use 'is None' to compare to None. 2015-10-04 17:05:24 +02:00
Florian Bruhin
7ff881c3e3 Merge branch 'incdec-setting' of https://github.com/Kingdread/qutebrowser into Kingdread-incdec-setting 2015-10-04 17:04:40 +02:00
Florian Bruhin
d229e90724 Fix some splelling mistakes. 2015-10-04 15:41:42 +02:00
Daniel
73ba3ddaee Add all possible combinations to FlagList.complete 2015-10-02 18:53:03 +02:00
Daniel
f12fbe875e Use a two-digit number for incdec tests 2015-10-02 11:44:54 +02:00
Florian Bruhin
7761dd5af4 configtypes: Disallow ValidValues without values. 2015-10-02 11:37:41 +02:00
Daniel
c78f83e692 Add port numbers to incdec_number tests 2015-10-02 11:27:56 +02:00
Florian Bruhin
240e271b0d tests: Translate platform markers to skipif marks.
This means pytest shows the correct location and the marks work correctly when
marking individual items in a parametrize marker.
2015-10-02 09:26:33 +02:00
Florian Bruhin
18bd20e109 Skip test_ipc:test_timeout on OS X.
It almost always causes issues and I have no idea why... Let's skip it for now.

Fixes #975.
2015-10-02 08:52:51 +02:00
Florian Bruhin
9f7836131d tests: Add a reason argument to platform markers. 2015-10-02 08:51:22 +02:00
Florian Bruhin
5c52d4d04e Fix TestGitStrSubprocess.test_real_git on Windows.
Fixes #939.
2015-10-02 07:36:06 +02:00
Florian Bruhin
93ed853c36 Fix tests on Xvfb.
Fixes #984.
2015-10-02 07:07:38 +02:00
Florian Bruhin
d6301beb2a Improve configtypes.Regex tests and docs. 2015-10-01 23:24:27 +02:00
Florian Bruhin
16ac3baf2e configtypes: Handle invalid escapes in regexes. 2015-10-01 23:11:48 +02:00
Daniel
c9a959043b Smarter tests for incdec_number
Now we generate possible combinations automatically instead of listing
several example values by hand.
2015-10-01 21:27:05 +02:00
Daniel
8228a96180 Stylistic changes, more testing for incdec 2015-10-01 20:57:08 +02:00
Alexey Nabrodov
293c9f1022 trying to fix tests 2 2015-10-01 16:34:34 +03:00
Alexey Nabrodov
044c0a0c4f trying to fix tests 2015-10-01 16:26:56 +03:00
Alexey Nabrodov
54d4f4f48b refactor and test 2015-10-01 15:57:11 +03:00
Daniel
4881d81444 Add new configtype: FlagList
This class contains validation code shared by ConfirmQuit and
URLSegmentList, that is it checks for duplicate values and compares
each value to valid_values.
2015-10-01 00:40:21 +02:00
Daniel
bc631d7d8b Fix configtypes test coverage 2015-09-30 21:17:27 +02:00
Daniel
1bdb012b2c Add a config option for navigate_incdec
Also known as Ctrl-A/Ctrl-X. You can now specify which parts of the URL
should be searched for numbers.

The setting is general->url-incdec-segments and it's a set with valid
values of 'host', 'path', 'query' and 'anchor'.
2015-09-30 19:18:00 +02:00
neeasade
2e62d24062 Empty osver for linux, adjust test to match this. 2015-09-29 13:59:22 -05:00
neeasade
ddeabc6643 Change dist() call in unit test. 2015-09-29 13:15:48 -05:00
Florian Bruhin
11961db72c Add maxlen argument to ErrorNetworkReply.readData.
This was missing before, causing a (hidden) exception with Python < 3.5, and
this with 3.5:

    TypeError: readData() takes 1 positional argument but 2 were given

    During handling of the above exception, another exception occurred:

    SystemError: PyEval_EvalFrameEx returned a result with an error set

Fixes #969.
2015-09-29 08:41:20 +02:00
Florian Bruhin
5db4ed0ed1 Add fallback argument to ConfigManager.get.
This is needed for interpolation since this change in Python 3.4:

https://hg.python.org/cpython/rev/267422f7c927

This broke qutebrowser in Debian experimental when updating python from
3.4.3-8 to 3.4.3-9 as they pulled from hg.

Fixes #968.
2015-09-29 08:22:33 +02:00
Florian Bruhin
4854ca42fd Fix tests without DISPLAY. 2015-09-28 21:50:55 +02:00
Daniel
3e2985d776 Add tests for RegexEq
...also fix a small typo in RegexEq's comment.
2015-09-28 14:58:00 +02:00
Daniel
05bcddb6f9 Use RegexEq in configtypes tests
This prevents the tests from failing if the regex cache overflows,
since re.compile objects compare by identitiy instead of patterns.
2015-09-28 14:24:36 +02:00
meles5
4fa2f34af4 Test for AppVeyor updated 2015-09-25 18:51:07 +02:00
meles5
70597d574f Added resource_url() function and used this function in the error page 2015-09-25 14:31:04 +02:00
Florian Bruhin
0de1e40f20 Add filescheme test for names with special chars.
Inspired by https://github.com/QupZilla/qupzilla/pull/1711
2015-09-24 06:45:33 +02:00
Florian Bruhin
311ae78bc3 Adjust check_coverage.py for coverage 4.0. 2015-09-21 07:42:10 +02:00
Florian Bruhin
a4569b11ad tests: Skip test_stale_legacy_server when frozen. 2015-09-17 22:02:12 +02:00
Florian Bruhin
fbf9c74752 tests: Increase some timeouts for OS X. 2015-09-17 21:22:35 +02:00
Florian Bruhin
7e84a1a5b8 Fix lint. 2015-09-17 20:02:39 +02:00
Florian Bruhin
0f69487f22 Adjust pylint ignores for py.path.
Since db513aa pylint can now import py, but fails because it can't infer that
there's a py.path.
2015-09-17 19:12:28 +02:00
Florian Bruhin
57242e925c Fix names of constants. 2015-09-16 23:00:02 +02:00
Florian Bruhin
d5baed5e83 Merge branch 'cookies_tests' of https://github.com/acogneau/qutebrowser into acogneau-cookies_tests 2015-09-16 22:58:28 +02:00
Florian Bruhin
0745de647b Allow debug.log_time to be used as decorator. 2015-09-16 22:50:19 +02:00
Florian Bruhin
545d82a04d utils.debug: Allow passing logger to log_time. 2015-09-16 22:38:31 +02:00
Florian Bruhin
1a1862a10d Increase timeout. 2015-09-16 20:26:31 +02:00
Florian Bruhin
88167ce4ce Shorten test IDs. 2015-09-16 20:25:02 +02:00
Florian Bruhin
0fa9da56bf Revert "ipc tests: Speed up TestListen::test_atime_update."
This reverts commit 443a2e1657.

We actually need to wait a bit to make sure the atime is updated.
2015-09-16 07:16:14 +02:00
Florian Bruhin
443a2e1657 ipc tests: Speed up TestListen::test_atime_update. 2015-09-16 07:13:31 +02:00
Florian Bruhin
7ffff72368 ipc: Make sure server is always shut down in tests.
Hopefully fixes #947.
2015-09-16 07:11:30 +02:00
Florian Bruhin
dd2a70e01f Fix IPC tests.
This was broken when adding some more logging.
2015-09-16 07:10:54 +02:00
Florian Bruhin
91b4ba2a48 Only run runtime test on Linux. 2015-09-15 22:31:37 +02:00
Florian Bruhin
d887bbeb24 Revert "standarddir: Fix runtime basedir test on OS X."
This reverts commit 46ac1e2bf90f1c74a1cc502e08b717715b90eb39.
2015-09-15 22:31:37 +02:00
Florian Bruhin
89b4adf158 standarddir: Fix runtime basedir test on OS X. 2015-09-15 22:31:37 +02:00
Florian Bruhin
00d6970c66 standarddir: Add some OS X tests. 2015-09-15 22:31:37 +02:00
Florian Bruhin
cc052a539f Add standarddir.download() tests. 2015-09-15 22:31:37 +02:00
Florian Bruhin
df095daf24 Simplify standarddir tests. 2015-09-15 22:31:37 +02:00
Florian Bruhin
04ec9c2624 Get rid of standarddir.temp() again. 2015-09-15 22:31:37 +02:00
Alexander Cogneau
ec11a61ed8 Fix failing tests 2015-09-13 23:08:31 +02:00
Alexander Cogneau
c08beda1aa Code cleanup 2015-09-12 22:11:14 +02:00
Florian Bruhin
e075e6c9df Clean up correctly after standarddir tests. 2015-09-11 21:20:45 +02:00
Florian Bruhin
5fe420efb5 standarddir: Fix TOCTOU issue when creating paths.
Fixes #942.
2015-09-11 18:21:20 +02:00
Florian Bruhin
5d90e0ecd3 Add a test for creating standarddir dirs. 2015-09-11 17:50:17 +02:00
Florian Bruhin
b06578a816 Fix lint. 2015-09-11 08:39:42 +02:00
Florian Bruhin
9ca001e71c Fix lint. 2015-09-11 08:32:45 +02:00
Florian Bruhin
c77956c9c5 Fix GUIProcess tests.
The logging checks were of little use and some tests were basically duplicated.
2015-09-11 08:32:16 +02:00
Florian Bruhin
28c8e4acbf Unskip GUIProcess tests on Windows. 2015-09-11 07:37:54 +02:00
Florian Bruhin
b126030f62 Revert "ipc: Skip problematic test on Ubuntu Trusty."
This reverts commit 729be7e7cc.
2015-09-11 07:37:13 +02:00
Florian Bruhin
d15cc07ed3 Log executed command for GUIProcess.
See #797.
2015-09-11 06:24:05 +02:00
Florian Bruhin
729be7e7cc ipc: Skip problematic test on Ubuntu Trusty. 2015-09-10 08:21:37 +02:00
Florian Bruhin
87ccc31cce ipc: Add some more tests for _atime_timer. 2015-09-10 08:02:19 +02:00
Florian Bruhin
58073fd768 ipc: Update the atime of the socket all 6h.
See #888.
2015-09-10 07:38:11 +02:00
Florian Bruhin
f7d3070c34 ipc: Fix start when a stale legacy server exists. 2015-09-09 19:39:01 +02:00
Florian Bruhin
37a2523bff Add a py_proc fixture to conftest.py. 2015-09-09 19:39:01 +02:00
Florian Bruhin
1d7c2b6b82 Don't set TMPDIR for test_legacy.
This has no real benefit and seems to break tests with some platforms.
2015-09-09 19:31:52 +02:00
Florian Bruhin
011b571336 Use a shorter tempdir. 2015-09-09 19:31:52 +02:00
Florian Bruhin
b135569d5c ipc: Add workaround for NameError w/ SocketOptions. 2015-09-09 19:31:52 +02:00
Florian Bruhin
69e735c42e ipc: Add username to hash instead. 2015-09-09 19:31:52 +02:00
Florian Bruhin
34bd000442 Use shorter names.
The typical test path for a legacy FIFO was something like:

    /tmp/pytest-92/test_correct_socket_name0/qutebrowser_test/qutebrowser-ipc-dfc627b5be8602ea0e9cd258b73c0bc3

This is probably too long for a Unix local domain socket (104 chars max).
2015-09-09 19:31:52 +02:00
Florian Bruhin
4daa7e6979 Don't add username to FIFO name on Linux.
The runtime directory already has a qutebrowser subdir.
2015-09-09 19:31:52 +02:00
Florian Bruhin
3573b57130 Set socket permissions correctly. 2015-09-09 19:31:52 +02:00
Florian Bruhin
78cb0eaf85 More work on #888 (new IPC path).
First trying the legacy path and then using the new one works fine now, but the
permissions are still wrong.
2015-09-09 19:31:52 +02:00
Florian Bruhin
a4bc4ad478 Only log a single message in utils.error.
This helps with seeing the full message with logfail.
2015-09-09 19:31:52 +02:00
Florian Bruhin
9d9372c6a8 Add standarddir.temp(). 2015-09-09 19:31:52 +02:00
Florian Bruhin
6a0994038e Start working on #888 (new IPC path). 2015-09-06 19:50:22 +02:00
Florian Bruhin
bfd8faafef Add a protocol version to IPC.
Fixes #909.
2015-09-06 18:43:24 +02:00
Florian Bruhin
b95fd2c814 Test raw json data for IPC. 2015-09-06 18:06:23 +02:00
Florian Bruhin
02a539f2d7 Rename TestError to Error. 2015-09-06 16:43:23 +02:00
Florian Bruhin
bf9a897ce8 Skip some more IPC tests on Windows. 2015-09-06 16:42:44 +02:00
Alexander Cogneau
851bf4cd31 Fix pylint 2015-09-06 16:13:41 +02:00
Alexander Cogneau
6541a360b1 Final cooikies tests 2015-09-06 00:24:38 +02:00
Alexander Cogneau
d36c701b07 Fixed comments 2015-09-04 11:44:59 +02:00
Florian Bruhin
9521da3c73 Fix error output with --no-err-windows. 2015-09-04 08:04:18 +02:00
Florian Bruhin
ea0cbea1dd ipc: Use a custom class for exceptions. 2015-09-04 07:12:23 +02:00
Florian Bruhin
2a4cd02704 100% coverage for misc.ipc. 2015-09-04 06:58:46 +02:00
Florian Bruhin
f77bdb7aec Adjust test_ipcserver_socket_none for prev commit. 2015-09-03 23:38:33 +02:00
Florian Bruhin
b40fb4dd43 ipc: Handle None-socket in slots correctly. 2015-09-03 20:48:51 +02:00
Alexander Cogneau
418328e61b Cookie tests done 2015-09-03 18:17:39 +02:00
Alexander Cogneau
96e3a0b1f1 first cookie tests 2015-09-03 17:24:01 +02:00
Florian Bruhin
27ee09a7a1 ipc: Skip test_normal on Windows. 2015-09-03 14:35:27 +02:00
Florian Bruhin
2f92ea92d8 test_ipc: Remove disconnect assert. 2015-09-03 11:55:21 +02:00
Florian Bruhin
f682477960 Fix some more IPC tests on Windows. 2015-09-03 11:55:17 +02:00
Florian Bruhin
ab9c046d54 Adjust default keybinding to clear-keychain on Esc.
Fixes #917.
2015-09-03 11:14:05 +02:00
Florian Bruhin
46b28387db Rewrite test_double_connection.
This caused various problems in the old form.
2015-09-03 06:38:35 +02:00
Florian Bruhin
efe40fa7e0 Try different workaround for test_ipc issues. 2015-09-03 06:12:36 +02:00
Florian Bruhin
154c380fd0 Fix pylint in test_ipc. 2015-09-02 23:32:06 +02:00
Florian Bruhin
d966720900 ipc tests: More tests. 2015-09-02 23:32:06 +02:00
Florian Bruhin
b4c90c5db4 ipc tests: Clean up qlocalsocket correctly.
If we don't do this, on_error will be invoked with old sockets, when
self._socket is None...
2015-09-02 23:32:06 +02:00
Florian Bruhin
6468e60a36 ipc tests: Fix waiting for FakeSocket. 2015-09-02 23:32:06 +02:00
Florian Bruhin
a63f0d5409 More IPC tests. 2015-09-02 23:32:06 +02:00
Florian Bruhin
38ebd806cc Add some tests for misc.ipc. 2015-09-02 23:32:06 +02:00
Florian Bruhin
0c3ee46fe0 Merge branch 'autoupdate_tests' of https://github.com/acogneau/qutebrowser into acogneau-autoupdate_tests 2015-09-01 08:48:52 +02:00
Alexander Cogneau
2d12c26e8c Add extra url assertion for autoupdate 2015-09-01 01:06:11 +02:00
Alexander Cogneau
8ab85d6246 small edits to autoupdate test 2015-08-31 09:30:16 +02:00
Florian Bruhin
8ea91b5bbc Fix cookiejar_and_cache move. 2015-08-31 08:00:21 +02:00
Florian Bruhin
03f4d738ab Rename klass fixture to klass_fixt.
See https://github.com/pytest-dev/pytest/issues/979.
2015-08-31 07:42:53 +02:00
Alexander Cogneau
ee77951e66 PEP8 fixes 2015-08-31 01:25:42 +02:00
Alexander Cogneau
e499d8932f 100% misc.autoupdate coverage 2015-08-31 01:10:04 +02:00
Florian Bruhin
79c1867e6c Don't save cookies when starting in private mode.
Whoops... :(

Fixes #903.
2015-08-30 23:17:48 +02:00
Florian Bruhin
6df00f8266 Move cookiejar_and_cache fixture to conftest.py. 2015-08-30 23:11:23 +02:00
Florian Bruhin
ed9a29fb9a test_cmdhistory: Remove patching for prev/nextitem. 2015-08-27 06:40:14 +02:00
Florian Bruhin
3fac246744 test_cmdhistory: Add test for __getitem__. 2015-08-27 06:38:41 +02:00
Florian Bruhin
4a48ef2573 Add my copyright. 2015-08-27 06:30:54 +02:00
Florian Bruhin
38c5abfc98 Remove unneeded self-parameter. 2015-08-27 06:30:12 +02:00
Florian Bruhin
66700e9a94 Remove exception string checks. 2015-08-27 06:28:26 +02:00
Florian Bruhin
4544c78395 Remove unneeded comments/monkeypatching. 2015-08-27 06:25:10 +02:00
Florian Bruhin
4fb3114af8 Merge branch 'cmdhistory_tests' of git://github.com/acogneau/qutebrowser into acogneau-cmdhistory_tests 2015-08-27 06:18:30 +02: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
Florian Bruhin
3e255eae64 Skip some tests when frozen. 2015-08-26 20:29:56 +02:00
Florian Bruhin
cb0e92b4e8 Only run test_check_coverage.py on Linux. 2015-08-26 20:20:08 +02:00
Florian Bruhin
2750c6ab5a Make check_coverage.py more testable and add tests. 2015-08-26 20:08:40 +02:00
Florian Bruhin
4f1c27d230 Merge branch 'basekeyparser_tests' of git://github.com/acogneau/qutebrowser into acogneau-basekeyparser_tests 2015-08-26 17:34:10 +02:00
Alexander Cogneau
cd34fc4b57 Small changes to basekeyparser tests 2015-08-26 12:13:47 +02:00
Alexander Cogneau
fd6e0559a6 remove unnecessary function 2015-08-26 12:10:25 +02:00
Alexander Cogneau
3a4069667a Remove test functions out of class 2015-08-26 12:07:47 +02:00
Florian Bruhin
8ffe591f98 Skip TestSave.test_long_output on Windows.
This seems to segfault unpredictably when exiting pytest and I can't find out
why.

Fixes #895.
2015-08-26 10:06:49 +02:00
Alexander Cogneau
9ef9224c32 Remove unecessary class 2015-08-26 00:20:14 +02:00
Alexander Cogneau
a1dff7d535 Final cmdhistory tests 2015-08-26 00:16:18 +02:00
Alexander Cogneau
d3488172ec Lift duration for test_debug 2015-08-25 22:41:54 +02:00
Alexander Cogneau
18d42d1f0a More tests for cmdhistory 2015-08-25 22:17:42 +02:00
Florian Bruhin
11f4fbc772 Silence pylint. 2015-08-25 21:24:58 +02:00
Florian Bruhin
38a07cc152 Fix lint. 2015-08-25 21:21:49 +02:00
Florian Bruhin
8c76db3892 Add some tests for progressbar sizing in statusbar. 2015-08-25 21:07:35 +02:00
Alexander Cogneau
26058f4e80 A few cmdhistory tests 2015-08-25 18:46:49 +02:00
Florian Bruhin
987b39885a sessions: Add more tests. 2015-08-25 17:49:45 +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