Commit Graph

1403 Commits

Author SHA1 Message Date
Florian Bruhin
eff0e4c7cc pylint: Enable useless-suppression globally.
We deactivate it locally where needed, i.e. where we are sure it's some
platform-specific thing.
2015-12-01 23:01:09 +01:00
Florian Bruhin
cf54fa1ef1 pylint: Remove some now useless suppressions. 2015-12-01 23:00:48 +01:00
Florian Bruhin
b3515f5e82 pylint: Remove import-error disabling from tests. 2015-12-01 22:47:10 +01:00
Florian Bruhin
5817b47f75 Revert "Use fully qualified imports in tests."
Seems like this also breaks frozen tests...
This reverts commit c7fdcc92b8.
2015-12-01 22:45:59 +01:00
Florian Bruhin
109984c96e pylint: Check attr-defined-outside-init for tests. 2015-12-01 22:41:16 +01:00
Florian Bruhin
803398c49b Use some more fixtures for older tests. 2015-12-01 22:40:58 +01:00
Florian Bruhin
c7fdcc92b8 Use fully qualified imports in tests.
This is cleaner even if pylint can't handle it.
2015-12-01 22:03:59 +01:00
Florian Bruhin
788a096150 pylint: Ignore import-error globally for tests. 2015-12-01 22:03:59 +01:00
Florian Bruhin
150a83d8f4 pylint: Remove unneeded supressions. 2015-12-01 22:03:58 +01:00
Tomasz Kramkowski
c575435782 misc/editor: Fix tempfile deleted on error / editor crash
This patch attempts to fix an issue where an error occuring in
misc/guiprocess or the editor process crashing would delete the
temporary file thus making it impossible to recover changes not commited
to the form field from the editor.
2015-12-01 20:22:05 +00:00
Florian Bruhin
d53c4f2702 tests: Increase test_late_message timeout.
This was failing on Travis on OS X, and waiting 1s for process start and 0.5s
sleep seems a bit tight.
2015-12-01 08:10:44 +01:00
Florian Bruhin
7e8f16dd22 pylint: Disable deprecated-method in test_conftest. 2015-12-01 07:16:53 +01:00
Florian Bruhin
6f9b02741a Switch from map() to list comprehensions. 2015-12-01 07:16:32 +01:00
Florian Bruhin
5f13fd2ece Merge branch 'log-javascript-console' of https://github.com/flv0/qutebrowser into flv0-log-javascript-console 2015-11-30 08:08:31 +01:00
Florian Bruhin
f7a13fa1f9 Rename LineParserWrapper to LineParserMixin.
This makes pylint shut up as it realizes it is, in fact, a mixin.
2015-11-30 07:11:35 +01:00
Florian Bruhin
288bf1524e Fix some unidiomatic comparisons. 2015-11-30 07:10:21 +01:00
Patric Schmitz
98a454a428 log-javascript-console -> [none, debug, info] 2015-11-29 18:37:11 +01:00
Florian Bruhin
d286f637d6 tests: Set basedir to None, not ''.
Turns out setting basedir='' creates cache/ in cwd.
2015-11-29 01:23:28 +01:00
Florian Bruhin
f7a3a9e015 Split testprocess.wait_for into two methods. 2015-11-29 01:23:19 +01:00
Florian Bruhin
6a46aea934 Fix tests for basedir logging.
f5febc4 broke various tests which called standarddir.init() without a valid
basedir.
2015-11-29 00:35:18 +01:00
Florian Bruhin
a67644589e bdd: Add first test for :bookmark-add. 2015-11-28 23:37:27 +01:00
Florian Bruhin
f9d7f20aac tests: Raise if wait_for is used without kwargs.
Otherwise wait_for would return immediately because matches is empty so
any(matches) is True.
2015-11-28 23:36:26 +01:00
Florian Bruhin
f5febc4807 Log basedir and save it in QuteProcess for tests. 2015-11-28 23:35:32 +01:00
Florian Bruhin
8d5b6b2dad bdd: Add tests for :home. 2015-11-28 22:44:05 +01:00
Florian Bruhin
052e758f38 bdd: Add tests for :help. 2015-11-28 22:34:19 +01:00
Florian Bruhin
c236e70920 Merge branch 'log-javascript-console' of https://github.com/flv0/qutebrowser into flv0-log-javascript-console 2015-11-28 21:12:25 +01:00
Florian Bruhin
83b94a8be5 Fix session tests.
FakeMainWindow needs to be a QObject now as we use sip.isdeleted since
8cf6ace0e7 and that raises a TypeError on
non-QObject's.
2015-11-28 20:41:42 +01:00
Patric Schmitz
913aa209c6 remove BadMappingSubclass and rename MappingSubclass 2015-11-28 20:17:31 +01:00
Patric Schmitz
dbc6f63fc0 remove whitespace 2015-11-28 18:57:41 +01:00
Patric Schmitz
03ba38578e set valid_values after __init__ consistently, move type validation out of class into pytest 2015-11-28 18:29:51 +01:00
Patric Schmitz
c14b52f916 initialize valid_values separately, not using base class __init__ parameter 2015-11-28 18:29:51 +01:00
Patric Schmitz
6f65397dfe always set valid_values in __init__ instead of class scope variable 2015-11-28 18:29:51 +01:00
Artur Shaik
73f999da31 Revert a43c206 and b344f92. 2015-11-28 21:29:54 +06:00
Florian Bruhin
f847ddf3cb bdd: Remove :rl-backward-delete-char test.
It's flaky and tested enough via unittests.
2015-11-27 20:29:49 +01:00
Florian Bruhin
bf3bd3bb9d Wait for favicon to be loaded for mhtml tests.
This hopefully helps with the flaky MHTML tests on Windows where the favicon
was loaded *after* clearing the requests:

http://qutebrowser.org:8010/builders/win8/builds/1370/steps/unittests-frozen/logs/stdio
2015-11-27 19:30:06 +01:00
Florian Bruhin
962ba36cda Skip qtutils.savefile_open tests without DISPLAY.
I don't get why, but for some reason they cause a segfault from time to time...
So let's just skip them.
2015-11-27 19:11:37 +01:00
Florian Bruhin
d6acb3c3f4 bdd: Hopefully make caret tests more stable.
We now wait until the clipboard actually changed, which should make things run
better.

This should fix the cases where the expected value is empty in #1142.
2015-11-27 18:44:59 +01:00
Florian Bruhin
d5b634301f Make :rl-backward-delete-char test more stable.
The text could be inserted *after* :rl-backward-delete-char was run.
2015-11-27 18:15:17 +01:00
Florian Bruhin
e9ca1ba5c1 bdd: Add a test for :rl-backward-delete-char. 2015-11-27 16:28:06 +01:00
Florian Bruhin
be4cf19bb1 tests: Improve some parametrized test IDs. 2015-11-27 16:25:25 +01:00
Florian Bruhin
f3c378858b tests: Remove duplicate test_split testcases. 2015-11-27 16:22:48 +01:00
Florian Bruhin
edf5463007 tests: Fix cmdline_test generation.
We accidentally provided valid values twice and invalid values not at all.
2015-11-27 16:17:07 +01:00
Florian Bruhin
84d6359990 bdd: Wait until page is loaded for tab-detach test
This should make this test more stable hopefully.
2015-11-27 15:18:53 +01:00
Florian Bruhin
b344f92a90 Add two missing xfail markers. 2015-11-27 15:10:08 +01:00
Florian Bruhin
a43c206893 Mark some caret tests as xfail on Windows/OS X.
See #1142.
2015-11-27 14:39:33 +01:00
Florian Bruhin
e4947b03be Fix lint. 2015-11-27 11:50:23 +01:00
Florian Bruhin
b4a630563f bdd: Add tests for caret mode. 2015-11-26 23:42:43 +01:00
Florian Bruhin
dbdedf74c0 bdd: Handle \n when checking clipboard contents. 2015-11-26 22:32:01 +01:00
Florian Bruhin
3d291482a3 bdd: Move clipboard functions to conftest.py.
Those are needed for caret.feature and yankpaste.feature.
2015-11-26 21:22:50 +01:00
Florian Bruhin
bf8a82db12 bdd: Add a test for :tab-detach. 2015-11-26 20:56:36 +01:00
Florian Bruhin
8d1a60528d bdd: Add some tests for :tab-clone. 2015-11-26 20:44:32 +01:00
Florian Bruhin
7f5e07d7cc bdd: Add some tests for :tab-move. 2015-11-26 18:37:47 +01:00
Florian Bruhin
3bcc80048d bdd: Move yankpaste.html to title.html. 2015-11-26 18:37:33 +01:00
Florian Bruhin
6f1474be71 bdd: Remove trailing dots. 2015-11-26 17:50:39 +01:00
Florian Bruhin
bc28a168cc bdd: Add tests for :tab-prev/:tab-next/tabs->wrap. 2015-11-26 16:19:03 +01:00
Florian Bruhin
102db181c5 Remove unused imports. 2015-11-26 15:55:40 +01:00
Florian Bruhin
7eb6f658eb tests: Use JSON for webserver_sub logging.
This simplifies logging output and parsing.
2015-11-26 14:40:20 +01:00
Florian Bruhin
b8467b8fef tests: Various cleanups. 2015-11-26 14:25:33 +01:00
Florian Bruhin
7baed5f80f tests: Don't start qutebrowser process if unneeded. 2015-11-26 13:56:42 +01:00
Florian Bruhin
fac76576d7 bdd: Add "the following tabs should be open" step.
This simplifies a lot of .feature files because we don't actually need to check
the full session.
2015-11-26 01:33:56 +01:00
Florian Bruhin
c861cf54e6 tests: Make QuteProcess.path_to_url public. 2015-11-26 01:33:27 +01:00
Florian Bruhin
fc328b275a bdd: Add some tests for :tab-focus. 2015-11-26 00:48:39 +01:00
Florian Bruhin
951c2e8eb6 Fix qflags_key comparison. 2015-11-25 18:54:03 +01:00
Florian Bruhin
c755a78518 bdd: Add tests for :tab-close/:tab-only. 2015-11-25 18:48:10 +01:00
Florian Bruhin
67f726c9d4 tests: Add another BOM test for javascript_escape. 2015-11-25 18:47:16 +01:00
Florian Bruhin
73e9fd1118 Handle BOM (\ufeff) for webelem.javascript_escape. 2015-11-25 18:14:52 +01:00
Florian Bruhin
816d62bca5 bdd: Reorganize numbered test files. 2015-11-25 18:02:14 +01:00
Florian Bruhin
eed2584e3f Fixup for last commit. 2015-11-25 17:55:33 +01:00
Florian Bruhin
0a7b552111 bdd: Use 'q' key for forward-unbound-keys test.
It seems ' gives us a 222 keycode with newer Qt versions, but 0 with older
ones. 'q' which is a much lower code should hopefully work better.
2015-11-25 17:52:00 +01:00
Florian Bruhin
21a1f9ca65 bdd: Add various key input tests. 2015-11-25 17:20:53 +01:00
Florian Bruhin
9670ffb78e bdd: Add "the JS message ... should not be logged". 2015-11-25 17:20:05 +01:00
Florian Bruhin
388cc7ae29 bdd: Add "Then ... should be logged" step. 2015-11-25 17:19:49 +01:00
Florian Bruhin
9fe02d55c9 bdd: Add "I press the keys ..." step. 2015-11-25 17:19:16 +01:00
Florian Bruhin
7cfea665ff tests: Strip trailing slash for webserver paths. 2015-11-25 10:40:24 +01:00
Florian Bruhin
24a71e5c2e Fix webelem.javascript_escape with U+2028/U+2029. 2015-11-25 10:32:22 +01:00
Florian Bruhin
027a10c04b bdd: Add some tests for :navigate. 2015-11-24 21:32:45 +01:00
Florian Bruhin
8f2b29a1f9 tests: Make it possible to load httpbin root. 2015-11-24 21:27:20 +01:00
Florian Bruhin
93ef85ff16 tests: Serve index.html files in webserver_sub.py. 2015-11-24 20:43:20 +01:00
Florian Bruhin
f8668ff710 bdd: Add a test for :open with -t and -b. 2015-11-24 20:31:08 +01:00
Florian Bruhin
c22e1df400 Add whitespace. 2015-11-24 19:24:39 +01:00
Florian Bruhin
28b739b9b5 bdd: Add tests for :open. 2015-11-24 19:19:23 +01:00
Florian Bruhin
287b2ba258 bdd: Replace (port) when setting a setting. 2015-11-24 19:19:03 +01:00
Florian Bruhin
925a5ba809 bdd: Add test for :debug-console. 2015-11-24 18:37:34 +01:00
Florian Bruhin
2ef2e3088f bdd: Add tests for :view-source. 2015-11-24 18:24:33 +01:00
Florian Bruhin
d58a5d4d15 bdd: Add "the page source should look like" step. 2015-11-24 18:22:43 +01:00
Florian Bruhin
b7323914b8 tests: Add plain arg to quteprocess.get_contents. 2015-11-24 18:22:20 +01:00
Florian Bruhin
7b1e2ab471 Skip some inspector tests on windows.
Those cause trouble because it can't clean up the local storage directory...
2015-11-24 17:48:09 +01:00
Florian Bruhin
d13ae4c666 tests: Make checks for focus window more forgiving.
It seems on OS X we get this instead of focusing the webview:
"Focus object changed: <qutebrowser.browser.inspector.WebInspector object at ...>"
2015-11-24 16:54:35 +01:00
Florian Bruhin
922fdc0526 Fix :fake-key with no focused webview. 2015-11-24 16:28:56 +01:00
Florian Bruhin
4c1eff625f tests: Make inspector smoke test more reliable.
Before we didn't wait until the inspector window was hidden, which caused the
following tests to fail on our OS X buildbot:

    ==================================== ERRORS ====================================
    _________ ERROR at teardown of test_fakekey_sending_key_to_the_website _________

    [...]

    tests/integration/testprocess.py:186: InvalidLine
    ----------------------------- Captured stdout call -----------------------------
    [...]
    INVALID: Traceback (most recent call last):
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/app.py", line 109, in <lambda>
    IGNORED:     target_arg=target_arg))
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/app.py", line 263, in process_pos_args
    IGNORED:     commandrunner.run_safely_init(cmd[1:])
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/runners.py", line 266, in run_safely_init
    IGNORED:     self.run(text, count)
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/runners.py", line 249, in run
    IGNORED:     result.cmd.run(self._win_id, args)
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/command.py", line 505, in run
    IGNORED:     self.handler(*posargs, **kwargs)
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/browser/commands.py", line 1781, in fake_key
    IGNORED:     tab='current')
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 215, in get
    IGNORED:     reg = _get_registry(scope, window, tab)
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 202, in _get_registry
    IGNORED:     return _get_tab_registry(window, tab)
    IGNORED:   File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 152, in _get_tab_registry
    IGNORED:     raise RegistryUnavailableError('tab')
    INVALID: qutebrowser.utils.objreg.RegistryUnavailableError: tab
    [...]

While this is a real issue, this test shouldn't affect the next one.

Since we have to wait for windows getting focused but Xvfb doesn't do that, we
skip this tests when running via Xvfb.
2015-11-24 16:17:26 +01:00
Florian Bruhin
542d13b70d tests: Add a not_xvfb marker. 2015-11-24 16:17:07 +01:00
Florian Bruhin
14f4689998 tests: Fix TestInitLog.
This worked before b0d4ebe because --debug was given and the
"args.loglevel.upper()" part was never executed.

However, loglevel is expected as a string, not as an int.
2015-11-23 21:50:48 +01:00
Florian Bruhin
9479a50784 bdd: Add a timeout to redirect-later with -1 delay. 2015-11-23 21:37:22 +01:00
Florian Bruhin
196d1e95be tests: Skip test_normal_connection IPC test on OS X.
Seems like it hangs there sometimes.
2015-11-23 20:33:11 +01:00
Florian Bruhin
607ca0f478 tests: Wait until page is dumped for header check.
If we don't do this, it's possible for the test process to delete the temporary
directory before qutebrowser actually writes the file.
2015-11-23 20:12:52 +01:00
Florian Bruhin
d4c24c935c bdd: Compare unordered req's for :reload --force. 2015-11-23 20:00:25 +01:00
Florian Bruhin
79680f505e Fix docstring. 2015-11-23 19:46:50 +01:00
Florian Bruhin
f3b89dba9b tests: Make test_reload/..._with_force more stable.
This waits until the pages have actually been reloaded.
2015-11-23 19:44:53 +01:00
Florian Bruhin
e2da9aa3f8 tests: Make test_stop more stable.
It's now based by the browser opening a second page after :stop is run rather
than timing-based, which hopefully should make it run more stable on Travis.
2015-11-23 19:43:11 +01:00
Florian Bruhin
d324dd5f70 bdd: Add "I open ... in a new tab" step. 2015-11-23 19:42:01 +01:00
Florian Bruhin
39f29e2531 tests: Wait until clipboard actually changed.
Hopefully fixes #1124.
2015-11-23 16:29:37 +01:00
Florian Bruhin
17b5ccde0e tests: Ignore "SelectionRequest too old" message.
See #1124.
2015-11-23 16:25:03 +01:00
Florian Bruhin
162c8b30e6 Remove unused import. 2015-11-23 14:49:37 +01:00
Florian Bruhin
7a82bb55e4 bdd: Add tests for :reload. 2015-11-23 14:37:54 +01:00
Florian Bruhin
1e79aae231 bdd: Add check_header step. 2015-11-23 14:37:40 +01:00
Florian Bruhin
76143574ef tests: Add quteproc.get_content. 2015-11-23 14:37:29 +01:00
Florian Bruhin
52aca30342 tests: Add quteproc.temp_setting. 2015-11-23 13:31:17 +01:00
Florian Bruhin
e6eaa5f140 tests: Add quteproc.get_setting. 2015-11-23 13:30:49 +01:00
Florian Bruhin
16e1a65448 Merge branch 'download-page' of https://github.com/Kingdread/qutebrowser into Kingdread-download-page 2015-11-23 13:16:16 +01:00
Florian Bruhin
ea06c64ed4 Fix typos. 2015-11-23 11:17:26 +01:00
Florian Bruhin
4fa32bd0cd bdd: Use a fresh instance for :stop test.
This hopefully makes it more stable on Travis on OS X.
2015-11-22 17:07:54 +01:00
Daniel Schadt
86eda2843d Normalize application/x-javascript
Should be just application/javascript
2015-11-21 16:19:01 +01:00
Florian Bruhin
39def173ca bdd: Fix request list for :stop test.
We changed the URL in the last commit but forgot to adjust that.
2015-11-21 15:31:19 +01:00
Florian Bruhin
eb232734b4 bdd: Increase timeouts for :stop test.
The old ones weren't enough for Travis it seems.
2015-11-21 15:14:32 +01:00
Florian Bruhin
4f165a7669 bdd: Add a test for :stop. 2015-11-21 14:23:44 +01:00
Daniel Schadt
7d6327873a Pass test only when mhtml file is written
Otherwise we might spill data to tests that come after the mhtml ones.
2015-11-21 12:45:57 +01:00
Daniel Schadt
59c9c6ccb0 Actually test :download --mhtml, not :download 2015-11-21 12:37:26 +01:00
Daniel Schadt
c7294781f5 Don't make ExpectedRequest orderable
Instead, make it hashable and use collections.Counter instead of sorted
lists. This actually produces a nicer output for differences between
the counters.
2015-11-21 00:20:09 +01:00
Daniel Schadt
c12011c84d Style fixes 2015-11-21 00:10:49 +01:00
Daniel Schadt
b776aeac84 Use same representation in webview and quteprocess
Otherwise the "page loaded" message will not be recognized.

Also use percent-encoding to avoid unicode-related bugs on different
systems.
2015-11-20 19:11:20 +01:00
Florian Bruhin
af875f4b8f Add a :fake-key command.
Closes #556.
See #551.
2015-11-20 19:06:06 +01:00
Daniel Schadt
0a9a75c337 Add more tests for the :download command 2015-11-20 18:31:39 +01:00
Daniel Schadt
0c2a285fef Convert to QUrl before waiting for the logline
webview uses QUrl to output the url and thus might convert some escape
sequences to their unicode characters. If we don't do the same
conversions here, we will "miss" the log message and fail the test.
2015-11-20 18:30:08 +01:00
Daniel Schadt
7f8c118991 Fix pylint 2015-11-20 16:57:27 +01:00
Daniel Schadt
cd78086d10 Fix pep257 2015-11-20 16:23:46 +01:00
Daniel Schadt
729d29b8a7 webserver: listen on 127.0.0.1 instead of 0.0.0.0 2015-11-20 16:17:34 +01:00
Daniel Schadt
09e310277d Remove server global, use lambda instead 2015-11-20 16:13:30 +01:00
Daniel Schadt
fb8f200291 Remove polling in webserver, use property instead 2015-11-20 16:11:13 +01:00
Daniel Schadt
613faf84ef Move pylint comment 2015-11-20 15:30:27 +01:00
Daniel Schadt
097a14d5f3 Disable pylint no-member for cherrypy.wsgiserver 2015-11-20 14:03:51 +01:00
Daniel Schadt
a991a8c43c Don't compare requests triggered by loading a page 2015-11-20 13:42:32 +01:00
Daniel Schadt
3466ee03f6 Change development server to cherrypy.wsgiserver
The Flask/Werkzeug development servers had some issues which lead to
failing tests (together with some Qt bugs).
2015-11-20 13:35:24 +01:00
Daniel Schadt
452c6f5310 Add __str__ method to ExpectedRequest
Better for reading test logs.
2015-11-20 13:35:24 +01:00
Florian Bruhin
1ec03462c8 Add a utils.parse_keystring. 2015-11-20 07:06:16 +01:00
Florian Bruhin
9a310dd1fb bdd: Add step to check for JS console.log. 2015-11-20 07:06:16 +01:00
Florian Bruhin
4d1f37f296 bdd: Add tests for :inspector. 2015-11-18 20:08:25 +01:00
Florian Bruhin
55992337b8 bdd: Add a --qute-delay argument. 2015-11-18 20:01:40 +01:00
Daniel Schadt
4060fd5e90 Fix mhtml tests 2015-11-18 19:56:49 +01:00
Daniel Schadt
3438a45b19 Merge branch 'master' into download-page 2015-11-18 19:27:26 +01:00
Daniel Schadt
0d6d276592 mhtml: remove non-existing ftp asset
This could be the cause of failing tests, depending on the OS.
2015-11-18 19:15:18 +01:00
Florian Bruhin
90c1240ad4 tests: Remove unnecessary override. 2015-11-18 18:29:27 +01:00
Florian Bruhin
dd2ec30b97 Revert "Use parametrization for TestKeyToString:test_all."
This reverts commit aa1ea9b063.

I changed my mind on this, generating >400 tests for this is stupid.
2015-11-18 18:15:21 +01:00
Florian Bruhin
516a81c3cc tests: Don't parse httpbin date.
We don't need the parsed date, and the parsing is locale dependent, which can
cause trouble.
2015-11-17 07:36:21 +01:00
Florian Bruhin
726525b26a bdd: Add some more tests for scrolling with floats. 2015-11-17 06:57:33 +01:00
Florian Bruhin
40e2258ef3 Don't accept floats for :scroll-px. 2015-11-17 06:57:13 +01:00
Florian Bruhin
71134f97e3 bdd: Wait for request with "... should be loaded".
Hopefully makes things less prone to race conditions.
2015-11-17 06:42:13 +01:00
Florian Bruhin
779df4c08e bdd: Use separate files for scroll navigate tests.
hello.txt was already cached from some other tests, so let's make sure a fresh
file gets loaded.
2015-11-17 06:40:23 +01:00
Florian Bruhin
7fe9be432a tests: Make httpbin.Request a proper class. 2015-11-16 23:24:11 +01:00
Florian Bruhin
bc96da47ef bdd: Tests for scrolling with non-scrollable page. 2015-11-16 20:35:44 +01:00
Florian Bruhin
a4d15b550e Abort :back/:forward at beginning/end of history. 2015-11-16 19:03:07 +01:00
Florian Bruhin
eef760359c Add missing 3.txt. 2015-11-16 07:17:53 +01:00
Florian Bruhin
6a4ea944cf bdd: Add tests with very big counts. 2015-11-16 07:17:43 +01:00
Florian Bruhin
fe08cb24f8 bdd: Test some commands with count. 2015-11-15 20:48:07 +01:00
Florian Bruhin
eeab4d41ba Make it possible to pass a count via command name.
This is only used for tests so far and not intended for general usage (and thus
undocumented).
2015-11-15 19:55:01 +01:00
Florian Bruhin
29a1620e81 bdd: Add tests for :scroll-page with --*-navigate. 2015-11-15 17:50:26 +01:00
Florian Bruhin
3d44d619fc bdd: Add some tests for :scroll-{perc,page}. 2015-11-15 16:38:56 +01:00
Florian Bruhin
1af30772b1 bdd: Add some comments to scroll.feature. 2015-11-15 16:38:56 +01:00
Florian Bruhin
4c75422c05 bdd: Add some :debug-webaction tests. 2015-11-15 16:38:56 +01:00
Florian Bruhin
145772476b bdd: Add some tests for :jseval. 2015-11-15 16:38:56 +01:00
Florian Bruhin
9f1c6e0139 bdd: Add some comments to misc.feature. 2015-11-15 16:38:56 +01:00
Florian Bruhin
384c753094 tests: Add ensure_not_logged to TestProcess. 2015-11-15 16:38:56 +01:00
Florian Bruhin
e9ece3d114 tests: Validate **kwargs for TestProcess.wait_for. 2015-11-13 23:26:14 +01:00
Florian Bruhin
9607fae935 Skip check_coverage.py with --lf. 2015-11-13 22:43:12 +01:00
Florian Bruhin
b61462ccb8 Fix the style fixes. 2015-11-13 22:41:37 +01:00
Florian Bruhin
1da7996c3b Style fixes. 2015-11-13 22:27:41 +01:00
Florian Bruhin
04c2e45bee bdd: Add a first test for :jseval. 2015-11-13 07:56:59 +01:00
Florian Bruhin
3290048458 tests: Do custom fnmatch-like matching.
fnmatch treats [, ] and ? as shell metacharacters too, and has no way to escape
them. We need a literal [] and really only need * for filtering.
2015-11-13 07:56:59 +01:00
Florian Bruhin
205af3737f bdd: Skip yankpaste tests if clipboard is broken.
This seems to be the case on OS X Yosemite (on my Mac Mini).
2015-11-13 06:54:45 +01:00
Florian Bruhin
0085421ec6 tests: Use __tracebackhide__ in wait_for methods. 2015-11-13 06:45:55 +01:00
Florian Bruhin
ce66d731f2 tests: Add missing file. 2015-11-13 06:24:53 +01:00
Florian Bruhin
40c7990d3a tests: Skip ipc TestSendToRunningInstance on OS X.
This did hang often on OS X, and I don't have the time to properly debug this.

See #1045.
2015-11-12 22:17:37 +01:00
Florian Bruhin
85c82b32fb tests: Only print ignored lines with invalid ones. 2015-11-12 22:13:56 +01:00
Florian Bruhin
1dd5bb1596 bdd: Add more tests for :zoom 2015-11-12 22:10:13 +01:00
Daniel Schadt
4210d7e15d mhtml: use png instead of ico for test
Seems like httpbin sends a different MIME-type on travis than on my
laptop, something 'clear' like image/png should fix this.
2015-11-12 21:58:33 +01:00
Florian Bruhin
00ccc236bb bdd: Add more :paste tests. 2015-11-12 21:52:39 +01:00
Florian Bruhin
25921792ef tests: Allow to open about:…/qute:… in QuteProc. 2015-11-12 21:52:06 +01:00
Daniel Schadt
354259777a mhtml: don't test with dynamically modified page 2015-11-12 21:07:14 +01:00
Daniel Schadt
69a92af097 mhtml: add "complex" test case
The html page is very ugly, but tests the downloader pretty throughout
2015-11-12 20:57:38 +01:00
Florian Bruhin
ba902f1d92 tests: Fix test_testprocess flakyness.
When we don't include the start time in the measurement, the subprocess will
already start sleeping before we start measuring, which can lead to times
measured which are around 260-300ms.
2015-11-12 20:29:06 +01:00
Florian Bruhin
9c5ce8a688 tests: Improve partial_compare output. 2015-11-12 19:04:37 +01:00
Daniel Schadt
30e2afb59d mhtml: reduce test flakiness
Waiting for "All assets downloaded" may lead to race conditions when
the output file is read before qute wrote it, so the test fails.
2015-11-12 13:17:10 +01:00
Florian Bruhin
1f3df64fe4 bdd: Add some first tests for :paste. 2015-11-11 22:38:43 +01:00
Florian Bruhin
3680f01576 Switch to pytest 2.8.
Closes #1077.

There were two issues:

- Paths for coverage.py suddenly were absolute instead of relative, so we strip
  the common base part if that happens.

  /home/florian/proj/qutebrowser/git/qutebrowser/browser/cookies.py has 100%
  coverage but is not in perfect_files!
  /home/florian/proj/qutebrowser/git/qutebrowser/browser/http.py has 100%
  coverage but is not in perfect_files!
  [...]

- There was an io.UnsupportedOperationError in test_check_coverage.py because
  of pytest-faulthandler, so we just don't load that in the subprocess.
2015-11-11 20:57:47 +01:00
Florian Bruhin
416cfaf002 tests: Switch from pytest-capturelog to catchlog. 2015-11-11 19:57:03 +01:00
Florian Bruhin
6bd45bbf24 tests: Add some code for MHTML integration tests. 2015-11-11 09:01:05 +01:00
Florian Bruhin
7cddd52b2d Merge branch 'download-page' of https://github.com/Kingdread/qutebrowser into Kingdread-download-page 2015-11-10 22:39:07 +01:00
Florian Bruhin
d99f9a3a20 Improve :set error messages. 2015-11-10 22:09:36 +01:00
Florian Bruhin
54e2cea460 Fix some corner cases with :set. 2015-11-10 21:27:42 +01:00
Florian Bruhin
a26e99f004 bdd: Add some tests for :set. 2015-11-10 21:07:49 +01:00
Florian Bruhin
128465f12b Add some more tests for :set-cmd-text. 2015-11-10 19:22:13 +01:00
Florian Bruhin
250f0e7410 Merge branch 'test-browser-cache-more' of https://github.com/lamarpavel/qutebrowser into lamarpavel-test-browser-cache-more 2015-11-10 18:57:28 +01:00
Florian Bruhin
d71618031d bdd: Decrease timeouts if not on CI. 2015-11-10 09:24:47 +01:00
Florian Bruhin
ada4b669bc tests: Strip [2s ago] markers from log messages. 2015-11-10 09:23:37 +01:00
Florian Bruhin
e1c6cd6c6d tests: Skip test_file for PyQIODevice on OS X.
Those seem to cause a hang on Travis on OS X sometimes.
2015-11-10 08:55:31 +01:00
Florian Bruhin
dc3bfb5eb4 bdd: Print ignored lines in testprocess. 2015-11-10 08:47:29 +01:00
Florian Bruhin
6b4dbad15b bdd: Wait until request is done for hints.feature. 2015-11-10 08:22:06 +01:00
Florian Bruhin
596ed5f545 bdd: Add some more back/forward tests. 2015-11-10 07:51:09 +01:00
Florian Bruhin
f440953ada bdd: Add step to start a fresh instance. 2015-11-10 07:51:09 +01:00
Florian Bruhin
6e7d6fb00e tests: Use fnmatch for strings in partial_match. 2015-11-10 06:50:31 +01:00
Florian Bruhin
3fac74656e bdd: Add some misc. tests. 2015-11-10 06:33:47 +01:00
Lamar Pavel
a2a1b77857 Undo unnecessary change 2015-11-10 03:45:38 +01:00
Lamar Pavel
fe8ddd79c0 Use config_stub.set instead of emitting sginal manually 2015-11-10 03:43:02 +01:00
Florian Bruhin
6579866abe Quote weird Qt functions for logging. 2015-11-09 19:55:05 +01:00
Florian Bruhin
d288c9598d tests: Add some quteprocess.LogLine tests. 2015-11-09 19:34:34 +01:00
Florian Bruhin
4f6415631f tests: Parse function/line being unset for LogLine. 2015-11-09 19:34:13 +01:00
Florian Bruhin
dce44f2dc5 bdd: Add some first tests for hints. 2015-11-09 18:20:23 +01:00
Florian Bruhin
1aebefca18 bdd: Make "I run ..." work with PrerequisitesError. 2015-11-09 18:20:23 +01:00
Daniel
a1bc020fec mhtml: Sanitize default filename suggestion 2015-11-09 17:01:08 +01:00
Daniel
5601c8e7c1 mhtml: Skip test if cssutils is unavailable
Instead of failing the test (assert cssutils is not None)
2015-11-09 17:01:08 +01:00
Daniel
ae8a9b8798 Handle non-ASCII in headers/url better 2015-11-09 17:01:08 +01:00
Daniel
f2f9529af7 Remove sys import in test_mhtml 2015-11-09 17:01:08 +01:00
Daniel
ed8a6a4c7b Update to cssutils 1.0.1
This fixes cssutils on Python 3.5 (yay!).
2015-11-09 17:01:08 +01:00
Daniel
3a2bb2d348 Add cssutils to README and utils/version.py 2015-11-09 17:01:08 +01:00
Daniel
dd8ff860f4 Fix lint 2015-11-09 16:59:16 +01:00
Daniel
b027e6af1b Mark cssutils tests as xfail on Python >= 3.5 2015-11-09 16:59:16 +01:00
Daniel
dab0db30a5 Remove tests for remove_file from test_mhtml.py 2015-11-09 16:59:16 +01:00
Daniel
957d68c477 Revert "Remove cssutils from mhtml.py"
This reverts commit 22a0f0952704d284846ab2572790d99a85515c57.
2015-11-09 16:59:16 +01:00
Daniel
ce1a99cc7c Remove cssutils from mhtml.py 2015-11-09 16:59:16 +01:00
Daniel
420c087373 use cssutils 2015-11-09 16:59:16 +01:00
Daniel
749b1c02cc Style changes for mhtml and test_mhtml 2015-11-09 16:59:16 +01:00
Daniel
b05a0d191d Fix module path in test_mhtml
Also fix docstring for _get_css_imports
2015-11-09 16:59:16 +01:00
Daniel
2eeace1c2c Move misc.mhtml to browser.mhtml 2015-11-09 16:59:16 +01:00
Daniel
a092ef1fe6 String quote style changes
"" for user facing strings
'' for internal strings
except when quotes appear inside a string, to avoid escaping them
2015-11-09 16:59:16 +01:00
Daniel
9bf9124324 Fix mhtml tests, add test for _NoCloseBytesIO 2015-11-09 16:59:16 +01:00
Daniel
bf90c8c06b Add tests for mhtml
This also makes the output of MHTMLWriter deterministic, by

1) Setting the boundary at object creation, allowing uuid.uuid4 to be
   monkey patched

2) Outputting the files in sorted order (sorted by location), as python
   dicts are unordered by default.
2015-11-09 16:59:16 +01:00
Florian Bruhin
0daf5885be Add some BDD tests for downloads. 2015-11-09 07:49:11 +01:00
Florian Bruhin
89c0ff0d9b bdd: Add a redirect-later page in webserver_sub.
This is needed for download tests.
2015-11-09 07:46:03 +01:00
Florian Bruhin
021ea444a1 bdd: Fix separations between tests.
With this change, no test should affect another one anymore. Changes in detail:

- Before each test, invalid lines are cleaned so the invalid output from the
  previous test doesn't affect the next one.
- Before each test, qutebrowser is restarted if it was quit.
- After each test, the data is cleared properly in every case.
- If there was an invalid output, the test waits for 1s for more output, and
  then terminates qutebrowser so it's restarted with a clean state.
2015-11-09 07:43:48 +01:00
Florian Bruhin
8b016df023 bdd: Make InvalidLine show some more informations. 2015-11-09 07:41:57 +01:00
Florian Bruhin
62f11273c5 tests: Fix quteproc.after_test() fixture.
It accidentally was named wrong, which caused it to never be executed. That
means the teardown log wasn't actually checked for errors.
2015-11-09 07:40:25 +01:00
Florian Bruhin
64730f566f tests: Make wait for loading work with downloads. 2015-11-09 07:39:24 +01:00
Florian Bruhin
8aa29a2ba2 bdd: Fix assert in "The requests should be" step.
When we call get_requests() inside the assertion, it won't act the same when
reinterpreting it.
2015-11-09 07:38:34 +01:00
Florian Bruhin
a05da2a956 bdd: Add a "then no crash should happen" step.
This is actually just a NOP, but helps in writing nice sentences ;)
2015-11-09 07:37:52 +01:00
Florian Bruhin
ae0e391c04 bdd: Add a "When I wait for the message ..." step. 2015-11-09 07:37:23 +01:00
Florian Bruhin
56bdb74ed9 bdd: Allow (port) replacement in "When I run ...". 2015-11-09 07:37:04 +01:00
Florian Bruhin
4c2e92c998 Make testprocess test more stable. 2015-11-06 07:17:15 +01:00
Florian Bruhin
25ecd9068c tests: Don't wait for the same line twice.
We need to search for lines in the history because we could miss something
otherwise, but for subsequent wait_for calls, we really don't want to wait for
the same thing again.

This should make test_backforward.py more stable as it *actually* waits when
going back now. Before, it did produce failures such as this one on OS X:

____________________________ test_going_backforward ____________________________
[..]
    @bdd.then(bdd.parsers.parse("The requests should be:\n{pages}"))
    def list_of_loaded_pages(httpbin, pages):
        requests = [httpbin.Request('GET', '/' + path.strip())
                    for path in pages.split('\n')]
>       assert httpbin.get_requests() == requests
E       assert [Request(verb...rward/1.txt')] == [Request(verb=...rward/2.txt')]
E         At index 3 diff: Request(verb='GET', path='/data/backforward/1.txt') != Request(verb='GET', path='/data/backforward/2.txt')
E         Full diff:
E         [Request(verb='GET', path='/data/backforward/1.txt'),
E         Request(verb='GET', path='/data/backforward/2.txt'),
E         Request(verb='GET', path='/data/backforward/1.txt'),
E         -  Request(verb='GET', path='/data/backforward/1.txt')]
E         ?                                              ^
E         +  Request(verb='GET', path='/data/backforward/2.txt')]
E         ?                                              ^
tests/integration/features/conftest.py:85: AssertionError
2015-11-06 07:02:17 +01:00
Florian Bruhin
f5f74b7ddc tests: Use a base class for testprocess lines. 2015-11-06 07:02:17 +01:00
Lamar Pavel
cbb9fd203a Fix test of existing metadata files
In test_cache_existing_metadata_file() we are now getting the correct
path to the metadata files, thus making the test useful. This was the
last missing test, the cache is now 100% covered (issue#999).
2015-11-05 23:08:38 +01:00
Florian Bruhin
5541e3ed32 bdd: Wait until title is loaded in yankpaste. 2015-11-05 08:03:03 +01:00
Florian Bruhin
b0430ca3e7 bdd: Make it possible to wait for messages. 2015-11-05 08:02:55 +01:00
Florian Bruhin
547fc9f40e Simplify testprocess tests. 2015-11-05 07:40:10 +01:00
Florian Bruhin
10e52c6e9f Make testprocess test more robust. 2015-11-05 07:39:31 +01:00
Florian Bruhin
bf74fda5b2 Fix lint. 2015-11-05 07:33:32 +01:00
Florian Bruhin
76f5f4fefb bdd: Remove now unnecessary sleep. 2015-11-05 07:07:43 +01:00
Florian Bruhin
beab639d7a bdd: Wait for finished loads in backforward. 2015-11-05 07:07:43 +01:00
Florian Bruhin
924b0052c6 bdd: Match historic messages in wait_for.
Fixes #1083.
2015-11-05 07:07:43 +01:00
Florian Bruhin
6c20190473 Merge branch 'master' of https://github.com/forkbong/qutebrowser into forkbong-master 2015-11-04 07:12:32 +01:00
Florian Bruhin
702842c977 configtypes: Handle max. recursion depth for Regex. 2015-11-04 07:02:23 +01:00
Panagiotis Ktistakis
dc06787f83 Make key config migration for clearing downloads. 2015-11-04 01:01:27 +02:00
Florian Bruhin
2c7b0d2fb4 Add some bdd tests for scrolling. 2015-11-03 22:42:25 +01:00
Florian Bruhin
49137150ad tests: Print raw yaml in get_session() in QuteProc. 2015-11-03 22:41:56 +01:00
Florian Bruhin
2427bf5cb6 bdd: Make expect_error handle warnings. 2015-11-03 22:40:19 +01:00
Florian Bruhin
17396e1030 bdd tests: Add QuteProc.get_session(). 2015-11-03 14:55:46 +01:00
Florian Bruhin
d992390cbe bdd: Move yankpaste/test.html to yankpaste.html. 2015-11-03 14:40:30 +01:00
Florian Bruhin
e31240e6c9 tests: Increase wait_for default timeout again. 2015-11-03 07:54:24 +01:00
Florian Bruhin
c78bbd9fd0 tests: Show some information for WaitForTimeout. 2015-11-03 07:53:51 +01:00
Florian Bruhin
535bcab310 bdd tests: Restart qutebrowser once per module.
This should be a good compromise between reproducibility and speed.
2015-11-03 07:00:46 +01:00
Florian Bruhin
f5eb755ef3 tests: Ignore some Qt warnings during teardown. 2015-11-03 06:38:48 +01:00
Florian Bruhin
7e0e770d53 bdd: Increase timeouts. 2015-11-03 06:35:52 +01:00
Florian Bruhin
e13de98790 Fix lint. 2015-11-02 23:49:44 +01:00
Florian Bruhin
7da0d2b6d5 Add some bdd tests for zooming. 2015-11-02 23:41:48 +01:00
Florian Bruhin
3155e20999 tests: Add helpers to compare sessions. 2015-11-02 23:41:48 +01:00
Florian Bruhin
ce6ba605e4 Reorganize bdd tests. 2015-11-02 20:32:15 +01:00
Florian Bruhin
bb4152d705 Add xfail test for vulture bug. 2015-11-02 18:25:16 +01:00
Florian Bruhin
1563693037 tests: Ignore "QIODevice::write: device not open". 2015-11-02 08:15:22 +01:00
Florian Bruhin
7431d7cf89 tests: Increase quteproc start timeout. 2015-11-02 08:08:36 +01:00
Florian Bruhin
8884de71d8 Fix checking for primary selection. 2015-11-02 08:07:25 +01:00
Florian Bruhin
672d11e25a Add bdd test for :yank/:paste. 2015-11-02 07:43:37 +01:00
Florian Bruhin
0d67cff5cb Merge branch 'bdd'
Conflicts:
      tests/test_conftest.py
      tox.ini
2015-11-02 06:36:30 +01:00
Florian Bruhin
56758c8cea Ignore messages which are in qt_log_ignore. 2015-11-02 06:19:19 +01:00
Florian Bruhin
6dc3b5de36 Add some margin to wait_for stopwatch. 2015-11-02 06:11:35 +01:00
Florian Bruhin
8e09fd929b Ignore QWaitCondition error. 2015-11-02 06:10:31 +01:00
Florian Bruhin
4451165a27 Change IPC warnings to debug.
This seems to show up on Ubuntu Trusty (with older Qt) as well...
2015-11-01 23:11:42 +01:00
Florian Bruhin
b79ccb5e79 bdd: Make message matching work. 2015-11-01 22:49:39 +01:00
Florian Bruhin
dac2898585 Parse log messages in LogLine. 2015-11-01 22:49:29 +01:00
Florian Bruhin
6431997a5a Add some testprocess tests. 2015-11-01 22:48:44 +01:00
Florian Bruhin
239bc3bdea Connect read_log before starting process. 2015-11-01 22:48:44 +01:00
Florian Bruhin
dfc1782bbf Add testprocess.wait_for to react to messages. 2015-11-01 22:48:44 +01:00
Florian Bruhin
70decdc2c8 Fix lint. 2015-11-01 22:47:58 +01:00
Florian Bruhin
4b683cdd8f Check invalid logs after exiting process. 2015-11-01 22:47:58 +01:00
Florian Bruhin
1c7fd7d80e Rename testprocess cleanup to terminate. 2015-11-01 22:47:58 +01:00
Florian Bruhin
18ead66f04 Fix odd QuteProc crash. 2015-11-01 22:47:58 +01:00
Florian Bruhin
5ed419c7f5 Make reloading more reliable.
Before, we didn't wait until the reload is done, which could lead to a race
condition.
2015-11-01 22:47:58 +01:00
Florian Bruhin
2be5c4cd27 Fix lint. 2015-11-01 22:47:58 +01:00
Florian Bruhin
1a562594fa Broken error message matching. 2015-11-01 22:40:11 +01:00
Florian Bruhin
3a948be490 Add test for unexpected error logging. 2015-11-01 22:40:11 +01:00
Florian Bruhin
ac148c11ec Skip bdd tests when frozen for now.
See:

https://github.com/pytest-dev/pytest-bdd/issues/158
https://github.com/pytest-dev/pytest-bdd/issues/159
2015-11-01 22:40:11 +01:00
Florian Bruhin
b878b139dd Ignore errors when decoding subprocess output.
This would otherwise fail on Windows because … get translated to an UTF-8 NEL
(U+0085)...
2015-11-01 22:40:11 +01:00
Florian Bruhin
be20001594 Adjust log regex to parse "Unknown module". 2015-11-01 22:40:11 +01:00
Florian Bruhin
ee8d538964 Run new qutebrowser instance for each test.
The possibilities how a test can affect another are just too high.
2015-11-01 22:40:11 +01:00
Florian Bruhin
8664e45558 Use httpbin.Request namedtuple for comparisons.
This makes it easier to look at the pytest diff when things go wrong.
2015-11-01 22:40:11 +01:00
Florian Bruhin
6e786ff9b7 Open in a new tab. 2015-11-01 22:40:11 +01:00
Florian Bruhin
4bf6359205 Rename Request.url to Request.path. 2015-11-01 22:40:11 +01:00
Florian Bruhin
c052c8a107 Don't show full debug log without --verbose. 2015-11-01 22:40:11 +01:00
Florian Bruhin
af000a8ac6 Wait longer for process to start. 2015-11-01 22:40:11 +01:00
Florian Bruhin
ffc465e863 First work-in-progress feature test. 2015-11-01 22:40:11 +01:00
Florian Bruhin
7d17957e90 Ignore inspect.getargspec() warning during tests.
https://github.com/pytest-dev/pytest-bdd/issues/153
2015-11-01 22:40:11 +01:00
Florian Bruhin
76fcec4e4c tests: First steps towards end-to-end tests. 2015-11-01 22:40:11 +01:00
Florian Bruhin
867f509bcc tests: Ignore QDisabledNetworkReply warning.
I guess they are displayed now during teardown with the changes in pytest-qt.
2015-11-01 18:04:09 +01:00
Florian Bruhin
3a522fb551 tests: Remove .close() workaround.
This is not needed anymore with pytest-qt 1.9.0.
2015-11-01 17:41:40 +01:00
Lamar Pavel
e86795f644 Add another test for pyqtslot on_config_changed
There are now two tests changing the config for private-browsing, covering
both True->False and False->True.
2015-11-01 14:55:03 +01:00
Lamar Pavel
70a6fe1561 Add tests triggering pyqtslot on_config_changed
Both settings relevant to the cache (cache-size and private-browsing) are
changed, a signal is emitted and the effect on the cache is verified.
2015-11-01 14:39:43 +01:00
Lamar Pavel
d127469d78 Add tests for fileMetaData()
One of those three tests is not complete as I couldn't yet find a way
to predict the path and name of cached files when using tmpdir.
2015-10-31 21:56:15 +01:00
Lamar Pavel
b94f7c7681 Add test for metaData() with cache deactivated 2015-10-31 18:49:58 +01:00
Lamar Pavel
404da750c6 Fix insertion into wrong cache 2015-10-31 18:32:14 +01:00
Lamar Pavel
571d7a680b Fix all other tests that weren't using DiskCache
So yeah, this explains a lot of the missing paths reported by the
coverage analysis.
2015-10-31 17:09:00 +01:00
Lamar Pavel
35762955cf Fix test_cache_remove_data
The test was not using qutebrowsers DiskCache class at all but Qts
QNetworkDiskCache. As a result the code paths of DiskCache.remove()
were never visited.
2015-10-31 16:57:00 +01:00
Lamar Pavel
3c2bc670ff Add test for alternate path of DiskCache.clear() 2015-10-31 16:33:01 +01:00
Lamar Pavel
e1446c3448 Add another test for deactivated cache
This one is testing the missing path in updateMetaData for a not activated
cache.
2015-10-31 16:28:17 +01:00
Lamar Pavel
39e37b043e Add more tests for deactivated cache
Getting closer to 100% completion, add tests for missing paths of
DiskCache.insert and DiskCache.cacheSize().
2015-10-31 16:13:29 +01:00
Florian Bruhin
468b2c4ade Merge branch 'test-browser-cache' of https://github.com/lamarpavel/qutebrowser into lamarpavel-test-browser-cache 2015-10-30 18:54:24 +01:00
Lamar Pavel
27ec9e1c43 Fix typo 2015-10-30 02:46:43 +01:00
Lamar Pavel
b5af1c8730 Add three tests querying and removing data
Two of these are testing return values of a deactivated cache and the
third is trying to query data that was never inserted into an active
cache.
2015-10-30 02:41:17 +01:00
Lamar Pavel
b3fa19eb96 Add sanity test involving almost everything 2015-10-30 02:03:34 +01:00
Lamar Pavel
05994ad90e Add theshold to cache-size test
The strict test condition before was violated by Qt internals which
seem to violate documented guarantees but are not part of qutebrowsers
code and thus can only be tested to a certain extent.
2015-10-30 01:22:16 +01:00
Lamar Pavel
9a8032fa91 Fix pylint errors (upper case variable names) 2015-10-29 03:13:25 +01:00
Lamar Pavel
a6526a1be2 Add tests to update and verify meta data of cache entries 2015-10-29 02:57:16 +01:00
Lamar Pavel
2cab750a54 Add test for DiskCache.remove() 2015-10-29 02:37:32 +01:00
Lamar Pavel
e4c79a68d1 re-write tests to fill the cache
Previously the tests were not adding any data to the cache, making the
tests for a cache size other than 0 meaningless.
The new tests create cache entries and fill them with some data that
can be tested against.
2015-10-29 02:28:57 +01:00
Florian Bruhin
6f07eb562f Revert "Don't use faulthandler plugin for check_coverage."
This reverts commit 497fba5667.
2015-10-28 08:22:41 +01:00
Florian Bruhin
497fba5667 Don't use faulthandler plugin for check_coverage. 2015-10-28 07:45:34 +01:00
Florian Bruhin
021a379dd2 Add xfailed test for #1070. 2015-10-26 21:02:34 +01:00
Florian Bruhin
c85aa40073 Skip connected_socket IPC tests on OS X.
Fixes #1045 - I don't have the time to look into this :-/
2015-10-26 09:04:41 +01:00
Florian Bruhin
883febe243 Return a QColor for qtutils.interpolate_color.
This broke the tests for older PyQt versions because the test had a
test_utils.Color(test_utils.Color(...)) object (double-wrapped), and the
comparisons failed there for some reason.
2015-10-26 06:45:36 +01:00
Florian Bruhin
bb5e5137cd configtypes: Allow completions for String. 2015-10-25 21:18:06 +01:00
Florian Bruhin
f614e5b98a Add none value for colors -> tabs.indicator.system. 2015-10-24 16:01:32 +02:00
Florian Bruhin
cdb9c0998f Add a comment for close() call. 2015-10-24 08:07:43 +02:00
Daniel
9722d4ba03 test_tabwidget: Make config_stub explicit
... also call TabWidget.close() at the end of the test.
2015-10-24 01:32:01 +02:00
Daniel
279d0926ee Remove unused import, make pylint happy 2015-10-23 19:52:56 +02:00
Daniel
0851999b89 Add unit/regression test 2015-10-23 19:52:56 +02:00
Lamar Pavel
24887a6564 Adjust coding style based on pylint warnings 2015-10-23 01:49:00 +02:00
Lamar Pavel
4a8dec5eb8 Code style; complete first batch of tests. 2015-10-21 22:31:46 +02:00
Lamar Pavel
82c608038d Coding style 2015-10-21 22:31:46 +02:00
Lamar Pavel
0b78fb65c9 Test if cleared cache is actually empty 2015-10-21 22:31:46 +02:00
Lamar Pavel
aa62a547d5 Use tmpdir fixture instead of "/foo/bar" 2015-10-21 22:31:46 +02:00
Lamar Pavel
a99d3f6525 Add first 3 tests for browser.cache
Note: test_cache_deactivated_private_browsing is currently failing
2015-10-21 22:31:46 +02:00
Daniel
ef8a681fcc Add TimestampTemplate config type
No more crash when 'completion->timestamp-format' is set to '%'.

Fixes #1039.
2015-10-21 17:23:39 +02:00
Florian Bruhin
4fb374e764 Fix test_run_vulture when frozen. 2015-10-21 06:11:07 +02:00
Florian Bruhin
aba31babca Add some tests for run_vulture.py. 2015-10-20 23:42:01 +02:00
Nathan Isom
ec3cafc293 resolve merge conflicts and merge branch scrollbar. 2015-10-18 11:42:56 -05:00
Florian Bruhin
82dfec6a18 Merge branch 'templatemagic' of https://github.com/neeasade/qutebrowser into neeasade-templatemagic 2015-10-18 18:20:41 +02:00
Nathan Isom
e92a7495c4 keep bg/fg test. 2015-10-18 10:41:15 -05:00
Nathan Isom
f1b9a3408f Remove fontdict test, edit register stylesheet test to match new font result. 2015-10-17 19:23:48 -05:00
Florian Bruhin
c8346a11fc Merge branch 'jinja' of https://github.com/meles5/qutebrowser into meles5-jinja 2015-10-17 19:04:36 +02:00
meles5
78c57ad416 Fixed AppVeyor test 2015-10-17 18:43:14 +02:00
meles5
2398762e85 Fix tests 2015-10-17 18:29:13 +02:00
Nathan Isom
9b8b2130ef remove deprecated test. 2015-10-16 10:59:02 -05:00
Nathan Isom
2a11adc8ac initial replace pass. 2015-10-16 10:52:02 -05:00
Nathan Isom
27db1ad891 fix scrollbar not showing up error, change test_get_stylesheet a bit. 2015-10-16 09:56:31 -05:00
Florian Bruhin
24dc166e1f tests: Use extend=True for qt_log_ignore marks.
This should finally resolve the warning flakiness on OS X.
2015-10-16 06:24:29 +02:00
Florian Bruhin
e6ee0c08cf testprocess: Restart process when it quits. 2015-10-14 21:52:11 +02:00
Florian Bruhin
f858af666f testprocess: Get executable/args from subclasses. 2015-10-14 21:52:11 +02:00
John ShaggyTwoDope Jenkins
65418307fd typos 2015-10-13 16:09:49 -07:00
Florian Bruhin
294eb19e61 Fix tests/integration/webserver.py when frozen. 2015-10-10 17:41:27 +02:00
Florian Bruhin
3e9088083f Raise correct InvalidLine exception. 2015-10-10 17:29:23 +02:00
Florian Bruhin
2f075c382b Move out test process handling to its own file. 2015-10-10 17:20:20 +02:00
Florian Bruhin
20bd1cc5fd Fix tests with 'DISPLAY='. 2015-10-08 06:36:38 +02:00
Florian Bruhin
0845671165 Start Xvfb for CI from tests. 2015-10-07 23:05:39 +02:00
Florian Bruhin
129df05932 ipc: Skip socketOptions test on Qt < 5.4. 2015-10-07 22:04:30 +02:00
Florian Bruhin
7db1f65425 ipc: Avoid using QLocalServer.setSocketOptions.
This causes problems with AddressInUseError being swallowed.

Fixes #997.
2015-10-07 21:52:09 +02:00
Florian Bruhin
52ced6c652 Start Xvfb for tests.
Fixes #851.
2015-10-07 16:54:46 +02:00
Jonas Schürmann
afc166a13e Coding style fixes #1002 2015-10-06 22:59:49 +02:00
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
2c719006cf tests: Fix skipping with multiple platform markers. 2015-10-02 10:39:21 +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
b88a22b139 tests: Add a not_osx platform marker. 2015-10-02 08:51:40 +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
Florian Bruhin
65891c6f0d Fail tests on Python warnings.
Fixes #982.
2015-10-01 21:34:00 +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
Florian Bruhin
f552f433f8 Rename stupidly named test. 2015-10-01 18:58:45 +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
1e5028a7f3 Allow unittests-nodisp to run w/o DISPLAY on CI. 2015-09-28 22:19:33 +02:00
Florian Bruhin
4854ca42fd Fix tests without DISPLAY. 2015-09-28 21:50:55 +02:00
Florian Bruhin
1861b0a5e4 Don't skip all tests without DISPLAY set.
We used qapp in a session scoped fixture, which means testing without DISPLAY
skipped all tests.
2015-09-28 21:50:44 +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
5ba7b5cf0f Fix lint. 2015-09-19 22:03:56 +02:00
Florian Bruhin
7d6c39d64b Run frozen smoke test via pytest. 2015-09-18 22:23:18 +02:00
Florian Bruhin
ae07e00038 Move httpbin stuff out of integration/conftest.py. 2015-09-18 20:20:06 +02:00
Florian Bruhin
a8a2fd2e7d Rename webserver.py to webserver_sub.py. 2015-09-18 20:08:31 +02:00
Florian Bruhin
a4569b11ad tests: Skip test_stale_legacy_server when frozen. 2015-09-17 22:02:12 +02:00
Florian Bruhin
2cb1f9226a Make httpbin tests run when frozen. 2015-09-17 21:51:09 +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
7eeabb2467 Fix integration tests with CRLF. 2015-09-17 19:52:56 +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
a6f113375c Add missing integration test data dir. 2015-09-17 19:10:16 +02:00
Florian Bruhin
c195ee225d Add missing docs and fix lint. 2015-09-17 19:02:03 +02:00
Florian Bruhin
c530312aca httpbin: Improve request parsing/logging. 2015-09-17 19:02:03 +02:00
Florian Bruhin
fd264631c4 Move httpbin data to data/ instead of html/. 2015-09-17 19:02:03 +02:00
Florian Bruhin
2bfb7609ac Show data in test_httpbin. 2015-09-17 19:02:03 +02:00
Florian Bruhin
48b599a774 Start work on httpbin integration tests. 2015-09-17 19:02:03 +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
b0c2021eca Revert "logfail: Update tests to use testdir."
This reverts commit f7e40f73ab.

Conflicts:
	tests/helpers/test_logfail.py
2015-09-09 08:49:51 +02:00
Florian Bruhin
2f8b39df1c Revert "logfail: Switch tests to subprocess pytest runs."
This reverts commit 09c265ddb0.
2015-09-09 08:49:17 +02:00
Florian Bruhin
f7c405d2f4 Revert "logfail: Continue running test and fail afterwards."
This reverts commit 66ed4e9c4e.
2015-09-09 08:49:06 +02:00
Florian Bruhin
909cafb516 Fix lint. 2015-09-09 07:58:14 +02:00
Florian Bruhin
66ed4e9c4e logfail: Continue running test and fail afterwards. 2015-09-09 07:58:14 +02:00
Florian Bruhin
09c265ddb0 logfail: Switch tests to subprocess pytest runs.
It seems they're much more reliable this way.
2015-09-09 07:58:14 +02:00
Florian Bruhin
f7e40f73ab logfail: Update tests to use testdir.
This makes more sophisticated tests easier.
2015-09-09 07:58:14 +02:00
Florian Bruhin
f5d9e967ef logfail: Rename capturelog module.
When trying to use this as conftest for the updated tests, pytest_* would be
interpreted as hook otherwise.
2015-09-09 07:58:14 +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
18af0b4b35 tests: Make FakeSignal callable. 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
0b911d2e20 Split integration tests, run smoke via pytest. 2015-09-01 08:54:53 +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
0cd265296e Add tests/html/jsalert_multiline.html. 2015-08-27 22:13:40 +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
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
Florian Bruhin
a8d549cb24 sessions: Add some more tests. 2015-08-24 17:12:20 +02:00
Florian Bruhin
f79e2c92a4 Read back session test data as UTF-8. 2015-08-24 08:44:41 +02:00
Florian Bruhin
9d601e8eb9 Fix session tests. 2015-08-24 08:31:11 +02:00
Florian Bruhin
8b40603562 Revert "Fix argparser test after win_registry change."
This reverts commit 70243d6e2f.
2015-08-24 08:05:34 +02:00
Florian Bruhin
e7a52a0833 Add some tests for misc.sessions. 2015-08-24 08:00:32 +02:00
Florian Bruhin
4f250ba5d7 tests: Allow tests to add windows to win_registry. 2015-08-24 08:00:16 +02:00
Florian Bruhin
70243d6e2f Fix argparser test after win_registry change.
The last focused window was now window 1 - so we better make this explicit.
2015-08-23 22:37:27 +02:00
Florian Bruhin
7bc5996d52 tests: Provide activeWindow() in FakeQApplication. 2015-08-23 21:55:25 +02:00
Florian Bruhin
9ff97d31da tests: Provide two windows in win_registry fixture. 2015-08-23 21:55:12 +02:00
Florian Bruhin
2556e2e27b Remove unused import. 2015-08-23 18:29:02 +02:00
Florian Bruhin
0907d8bf76 tests: Add a webview fixture. 2015-08-23 18:17:22 +02:00
Florian Bruhin
6d8854bc07 Simplify usage of tabhistory.TabHistoryItem. 2015-08-23 18:16:19 +02:00
Alexander Cogneau
193a8d5242 Add unit tests for KeyInput.BaseKeyParser 2015-08-22 23:26:13 +02:00
Florian Bruhin
543053c8f5 test_signalfilter: Remove unused fixture. 2015-08-20 07:14:32 +02:00
Florian Bruhin
7ee4d2f2c9 100% test coverage for commands.argparser. 2015-08-20 07:14:25 +02:00
Florian Bruhin
774ef58432 Use qapp fixture in enable_caret_browsing.
This fixes a segfault when only running test_position_caret.
2015-08-19 21:40:13 +02:00
Florian Bruhin
1a1bc4b8a8 Fix lint. 2015-08-19 21:13:35 +02:00
Florian Bruhin
a79c139aa4 Revert "style: Check for QColor when setting in ColorDict."
This reverts commit 9b82fae6fb.
2015-08-19 20:48:19 +02:00
Florian Bruhin
5a975d1b90 100% test coverage for config.style. 2015-08-19 20:43:06 +02:00
Florian Bruhin
b11e075047 Add __getitem__ to ConfigStub. 2015-08-19 20:39:48 +02:00
Florian Bruhin
1ddd65304a tests: Use a real signal for ConfigStub. 2015-08-19 19:37:19 +02:00
Florian Bruhin
3d4fd2652b test_editor: Skip un{read,writ}able on Windows.
Windows doesn't really have working file permissions...
2015-08-19 10:18:55 +02:00
Florian Bruhin
086c6c81a1 Simplify message_mock usage and assert more things. 2015-08-19 09:44:31 +02:00
Florian Bruhin
685bbaae6d 100% test coverage for misc.editor. 2015-08-19 09:34:44 +02:00
Florian Bruhin
aa367fa004 Simplify test_editor. 2015-08-19 09:09:09 +02:00
Florian Bruhin
acfdf8b956 Fix lint. 2015-08-19 07:57:47 +02:00
Florian Bruhin
aca082ce83 100% test coverage for misc.guiprocess. 2015-08-19 07:57:02 +02:00
Florian Bruhin
4efa022528 Fix test_checkpyver on Pythons without Tkinter. 2015-08-19 07:12:04 +02:00
Florian Bruhin
1a61e53daa 100% test coverage for misc.checkpyver. 2015-08-19 05:58:52 +02:00
Florian Bruhin
e4a0f1972f tests: Improve MessageMock and use it. 2015-08-18 21:38:18 +02:00
Florian Bruhin
6d1b0ba260 Clean up conftest.py. 2015-08-18 20:43:42 +02:00
Florian Bruhin
2c5269acd6 Reorganize tests directory. 2015-08-18 20:19:02 +02:00
Florian Bruhin
d8734a668c Add workaround for pytest-capturelog bug.
This should fix the tests on Windows.
See https://bitbucket.org/memedough/pytest-capturelog/issues/7/
2015-08-18 08:06:41 +02:00
Florian Bruhin
1e08a6a202 Fix message box tests on OS X.
From the QMessageBox::setWindowTitle docs:

     On Mac OS X, the window title is ignored (as required by the Mac OS X
     Guidelines).
2015-08-17 23:37:55 +02:00
Florian Bruhin
5d013a67a7 100% coverage for misc.msgbox. 2015-08-17 23:18:52 +02:00
Florian Bruhin
9892c10f49 100% test coverage for utils.error. 2015-08-17 23:18:39 +02:00
Florian Bruhin
9cd2f6ba24 100% test coverage for commands.cmdutils. 2015-08-17 21:13:13 +02:00
Florian Bruhin
00d81a74c2 100% coverage for browser.network.networkreply. 2015-08-17 07:16:33 +02:00
Florian Bruhin
e909b1f36d Fix lint. 2015-08-16 23:20:30 +02:00
Florian Bruhin
dff4c37f54 100% test coverage for browser/signalfilter.py. 2015-08-16 23:16:13 +02:00
Florian Bruhin
75fd97f74f Skip command test. 2015-08-16 22:51:00 +02:00
Florian Bruhin
6656e6aa9b Merge branch 'command-tests' 2015-08-16 22:48:07 +02:00
Florian Bruhin
8655ebc9c8 Ignore "load glyph failed" message in JS test. 2015-08-16 22:00:21 +02:00
Florian Bruhin
044a63d4a4 Skip all GUIProcess tests on Windows. 2015-08-16 21:46:36 +02:00
Florian Bruhin
d94c1736db Use a proper file:// URL for dirbrowser icons. 2015-08-16 19:04:54 +02:00
Florian Bruhin
a6c104f0ef Fix TestFileSchemeHandler.test_dir on Windows. 2015-08-16 18:28:46 +02:00
Florian Bruhin
2a0dd341de Move test_filescheme.py. 2015-08-16 18:27:26 +02:00
Antoni Boucher
abeb7e3390 Fixed issues. 2015-08-13 19:54:23 -04:00
Florian Bruhin
b3df642b21 Write more tests for dirbrowser. 2015-08-13 21:56:22 +02:00
Antoni Boucher
77190554cc Merge branch 'master' into feature/directory-browser 2015-08-12 16:57:45 -04:00
Florian Bruhin
591a5b8c56 Revert "Add a workaround for pytest-html surrogate issue."
This reverts commit 9c3c46f677.
2015-08-12 18:27:41 +02:00
Florian Bruhin
6f4141956b Merge branch 'dynamic-column-widths' of git://github.com/acogneau/qutebrowser into acogneau-dynamic-column-widths 2015-08-12 18:20:01 +02:00
Alexander Cogneau
5a0b160736 Remove whitespace 2015-08-12 11:02:41 +02:00
Alexander Cogneau
61a6b196e9 Parametrization for completion tests 2015-08-12 09:08:04 +02:00
Florian Bruhin
25b43d528c Clear textbase text properly. 2015-08-12 07:41:06 +02:00
Florian Bruhin
5a1663c584 100% coverage for mainwindow.statusbar.textbase. 2015-08-12 07:40:45 +02:00