Florian Bruhin
d6fafd474b
pylint: Disable no-member for http.client.*
...
Seems like this is potentially the same issue as
https://github.com/PyCQA/pylint/issues/399 , it also happens on the same
machines.
2016-01-17 21:27:24 +01:00
Florian Bruhin
0936ed4e61
Disable useless-suppression in webserver_sub_ssl.
...
Seems like this pylint bug doesn't happen on all systems...
2016-01-17 21:21:26 +01:00
Florian Bruhin
11dc51031d
tests: Increase timeout for quteprocess_quitting.
2016-01-17 21:20:28 +01:00
Florian Bruhin
9c5974c054
bdd: Add a "qutebrowser should quit" step.
2016-01-17 20:59:39 +01:00
Florian Bruhin
6e390bdc01
tests: Add a quteproc test for quitting.
2016-01-17 20:46:55 +01:00
Felix Van der Jeugt
9a889c6866
extended tests to cover new file argument
2016-01-17 20:38:33 +01:00
Florian Bruhin
6c5e158fc5
tests: Add a test for a quitting testprocess.
2016-01-17 20:19:41 +01:00
Florian Bruhin
dd211adf0f
tests: Make sure testprocess raises if start fails.
2016-01-17 20:18:07 +01:00
Florian Bruhin
6774894e9e
tests: Check HTTP server status per path.
...
Stricter and simpler, ha! :)
2016-01-15 07:13:45 +01:00
Florian Bruhin
40721a2b6b
bdd: Wait until basic-auth page is fully loaded.
...
This hopefully fixes this flakyness in
test_successful_webpage_authentification:
tests/integration/features/test_prompts.py:129:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[...]
tests/integration/features/conftest.py:381: in check_contents_json
actual = json.loads(content)
/usr/lib/python3.4/json/__init__.py:318: in loads
return _default_decoder.decode(s)
/usr/lib/python3.4/json/decoder.py:343: in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[...]
> raise ValueError(errmsg("Expecting value", s, err.value)) from None
E ValueError: Expecting value: line 1 column 1 (char 0)
2016-01-15 06:51:48 +01:00
Florian Bruhin
6420cdaa26
bdd: Open geolocation/notification page in new tab
...
This hopefully fixes this flaky error in test_notifications_with_ask__true on
OS X:
Failed: Logged unexpected errors:
LogLine('22:40:06 DEBUG js webpage:javaScriptConsoleMessage:531 [http://localhost:57758/data/prompt/notifications.html:28 ] [FAIL] unknown initial value for Notification.permission: denied')
[...]
testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Entering mode KeyMode.* (reason: question asked)'}.
2016-01-15 06:44:01 +01:00
Florian Bruhin
5856b24d20
bdd: Compare HTTP status to a whitelist.
...
401 (authorization required) is not < 400, and it makes more sense to be strict
here anyways.
2016-01-14 22:34:26 +01:00
Florian Bruhin
cda6d7c06d
bdd: Add test for webpage authentication.
2016-01-14 22:27:09 +01:00
Florian Bruhin
573654ece1
bdd: Add check_contents_json.
2016-01-14 22:27:00 +01:00
Florian Bruhin
c79f013050
bdd: Allow to load a page without waiting for it.
2016-01-14 22:26:42 +01:00
Florian Bruhin
23107a242b
bdd: Ignore POSITION_UNAVAILABLE for geolocation.
2016-01-14 20:40:46 +01:00
Florian Bruhin
0b116729f7
bdd: Fix skipping tests from JS.
...
With the previous solution, we'd call pytest.skip on teardown only, which means
the rest of the test (e.g. because of a wait_for) could still fail.
2016-01-14 20:32:17 +01:00
Florian Bruhin
b8a50dc475
bdd: Log error code on geolocation errors.
2016-01-14 19:04:48 +01:00
Florian Bruhin
e7a816c0c0
bdd: Skip geolocation tests if it's unavailable.
...
This should unbreak the build with older Qt versions.
2016-01-14 18:51:28 +01:00
Florian Bruhin
9c87eaf371
bdd: Allow to skip a test from JS.
...
This is a bit tricky since the test will actually run, but be marked as
skipped. The problem is we can't raise a pytest.skip.Exception during a test,
or it'll show up as an exception in a virtual Qt method.
Still this is better than nothing.
2016-01-14 18:50:36 +01:00
Florian Bruhin
14ff684e99
bdd: Add a xfail_norun marker.
2016-01-14 07:53:00 +01:00
Florian Bruhin
cf09e477a4
bdd: Add some tests for HTML5 notifications.
2016-01-14 07:49:39 +01:00
Florian Bruhin
1ddf817f4c
bdd: Add some tests for geolocation.
2016-01-14 07:30:52 +01:00
Florian Bruhin
252dc5bf1b
bdd: Add ability to fail tests from javascript.
2016-01-14 07:03:55 +01:00
Florian Bruhin
1d63e2dff4
bdd: Make "I wait for a prompt" step explicit.
2016-01-14 07:03:55 +01:00
Florian Bruhin
abcb366c12
bdd: Add some more SSL tests.
2016-01-13 22:36:45 +01:00
Florian Bruhin
d0fda5467a
bdd: Add a "I wait for a prompt" step.
2016-01-13 22:36:45 +01:00
Florian Bruhin
9c2a38938d
bdd: Clear SSL errors before SSL test.
2016-01-13 22:36:45 +01:00
Florian Bruhin
0e631a2c11
bdd: Mark should_be_logged messages as expected.
2016-01-13 22:36:45 +01:00
Florian Bruhin
2fbf218a0f
bdd: Use textwrap.dedent.
2016-01-13 18:29:14 +01:00
Florian Bruhin
7ccc58bb68
Remove empty line.
2016-01-13 18:13:16 +01:00
Florian Bruhin
6c916d166d
Merge branch 'master' of https://github.com/hcraT/qutebrowser into hcraT-master
2016-01-13 18:12:37 +01:00
Florian Bruhin
e17a332400
Fix lint.
2016-01-13 07:01:31 +01:00
Florian Bruhin
0ca9cd361a
Fix webserver_sub_ssl file header.
2016-01-13 00:00:55 +01:00
Florian Bruhin
f515165140
Add docstring.
2016-01-12 23:51:36 +01:00
Florian Bruhin
5f2ca88176
bdd: Don't test exact SSL error text.
...
Turns out those are platform specific.
2016-01-12 23:50:25 +01:00
Florian Bruhin
9479b65d25
bdd: Add first SSL test.
2016-01-12 23:35:48 +01:00
Florian Bruhin
8dd7f080f4
tests: Default to 5s timeout if not on CI.
2016-01-12 22:49:54 +01:00
Florian Bruhin
adbdfcbad3
tests: Add an SSL server subprocess.
2016-01-12 22:48:38 +01:00
Florian Bruhin
25dbf3731b
tests: Split wait_for_load_finished from open_path.
2016-01-12 22:47:09 +01:00
Florian Bruhin
df03099468
Fix completion for String config type.
...
Since 2a705e2eb6
non-specialized config types are
String. However, String had an overloaded complete() which defaulted to
returning None.
Now we use the normal complete() which relies on valid_values if completions
isn't given instead.
Fixes #1223 .
2016-01-12 18:53:53 +01:00
Tarcisio Fedrizzi
f813bc2415
Adds unit test to check that paths ending with newlines are handled
...
correctly
2016-01-12 11:27:11 +01:00
Tarcisio Fedrizzi
5917bbbe5c
Fixes wrong indentation in multiline clipboard text
2016-01-12 11:25:14 +01:00
Tarcisio Fedrizzi
524341fd7a
Use textwrap.dedent to parse multiline clipboard text
2016-01-12 11:24:31 +01:00
Tarcisio Fedrizzi
f08704e789
Adds function to insert multiple lines in the clipboard
2016-01-12 09:59:03 +01:00
Florian Bruhin
22d255f49f
bdd: Skip JS prompt() tests on PyQt < 5.3.1.
...
Those versions had a PyQt bug when overloading javaScriptPrompt, so we don't do
that there.
2016-01-12 09:04:03 +01:00
Florian Bruhin
df40b39e3e
Work around pytest madness.
2016-01-12 08:20:08 +01:00
Florian Bruhin
046194ad6f
bdd: Add first tests for JS prompt/confirm/alert.
2016-01-12 08:04:56 +01:00
Florian Bruhin
3f21accaeb
tests: Use sip.delete to clean up prompt.
...
It looks like using deleteLater and waiting for the destroyed signal took too
long on the buildbot: http://www.qutebrowser.org/testresults/osx/1245.html
2016-01-11 07:38:58 +01:00
Florian Bruhin
70cd18fc98
100% coverage for mainwindow/statusbar/prompt.py.
2016-01-11 07:14:51 +01:00
Florian Bruhin
20610807c1
tests: Add missing files.
2016-01-10 22:08:52 +01:00
Florian Bruhin
97d5342f0c
Adjust hypothesis setting for 2.0.
2016-01-10 21:57:06 +01:00
Florian Bruhin
fce4351463
bdd: Add some tests for quickmarks.
2016-01-10 21:21:32 +01:00
Tarcisio Fedrizzi
1b31a3fee4
Allows to paste multiple URLs
...
- The paste command will now open one tab/window per url if multiple
URLs (separated by newline) are present in the clipboard
- Adds the tests for the new multitab functionality
- Changes test/integration/conftest.py to be able to insert newlines in
the clipboard for the test
2016-01-09 11:32:12 +01:00
Florian Bruhin
c385580b81
bdd: Add some tests for bookmarks.
2016-01-09 00:15:57 +01:00
Florian Bruhin
4ef0c3e09f
tests: Ensure lines look right when checking tabs.
2016-01-09 00:14:57 +01:00
Florian Bruhin
8ca85b9c66
Also show testprocess output on teardown errors.
2016-01-08 12:53:36 +01:00
Florian Bruhin
ab79cd2496
tests: Avoid pytrace=False for now.
...
Using pytest.fail with pytrace=False hides the quteprocess output, which makes
it a lot harder to debug stuff.
This is because TestReport.longrepr is suddenly a string and we can't add infos
to it - see https://github.com/pytest-dev/pytest/issues/1316
2016-01-08 12:35:12 +01:00
Florian Bruhin
ff2024a565
Add socket IDs to ipc debug messages.
2016-01-08 12:02:36 +01:00
Florian Bruhin
ab0cd17772
Fix lint.
2016-01-08 10:00:42 +01:00
Florian Bruhin
9ed79ad57d
tests: Switch to qtbot.assertNotEmitted.
2016-01-08 10:00:42 +01:00
Florian Bruhin
f004e45566
tests: Remove pointless CookieJar test.
...
There's no code between those two lines which could possibly emit that signal.
2016-01-08 09:57:04 +01:00
Florian Bruhin
1fb34331e5
tests: Default to raising=True for qtbot.
...
- qtbot.waitSignal with raising=True is the default this way, so we remove the
raising=True.
- qtbot.waitSignal with raising=False stay untouched
- Some qtbot.waitSignal without raising had one added (because we don't want it
to raise)
- Some qtbot.waitSignal without raising actually should've raised, which they
do now.
2016-01-08 09:49:06 +01:00
Florian Bruhin
eebed7a5a7
tests: Poll clipboard for changes.
...
For some reason I can't explain, since 2b0870084b
we got test failures on OS X, as the clipboard had the old value before waiting
for the change, the new (correct) value after waiting for it, but never
actually emitted 'changed'.
We could just re-check the contents after the timeout, but that'd mean we wait
1s for every test where this weird thing happens.
Instead, we poll the clipboard for every 100ms as long as the timeout (1s)
hasn't passed, and return as soon as it has the correct contents.
2016-01-08 09:35:03 +01:00
Florian Bruhin
eef1604dcd
tests: Improve WaitForClipboardTimeout message.
2016-01-08 08:35:34 +01:00
Florian Bruhin
0d9cbba3b9
tests: Dump contents in WaitForClipboardTimeout.
2016-01-08 01:56:27 +01:00
Florian Bruhin
aecf410707
Make pylint shut up about pytest.config.
2016-01-08 01:16:58 +01:00
Florian Bruhin
2b0870084b
bdd: Run :tab-only between tests for caret/search.
...
Otherwise we end up opening a lot of tabs which slow down qutebrowser,
The latest issue in #1183 might actually be caused by that.
2016-01-08 00:58:01 +01:00
Florian Bruhin
5eafccb604
tests: Print logs live when -s is given.
2016-01-07 21:15:24 +01:00
Florian Bruhin
9e9cedf3e0
tests: Shorten (not suppress) quteproc log w/o -v.
...
The output was almost always useless without -v because the debug log wasn't
shown at all, only error/info.
Now we display a maximum of 50 lines (regardless of what level) without -v.
2016-01-07 19:41:49 +01:00
Florian Bruhin
df6d9d741f
bdd: Add search tests for known bugs/regressions.
...
This adds a test for #874 , #507 and #940 .
2016-01-07 19:41:26 +01:00
Florian Bruhin
37022b8c45
bdd: Improve search tests.
2016-01-07 08:21:18 +01:00
Florian Bruhin
18b5860584
bdd: Add "When I open ... in a new window" step.
2016-01-07 08:20:48 +01:00
Florian Bruhin
f9645e447a
bdd: Add first tests for searching.
2016-01-07 07:49:45 +01:00
Florian Bruhin
6a592576eb
bdd: Fix timeout exception in _wait_for_clipboard.
2016-01-07 07:43:36 +01:00
Florian Bruhin
360f0b6180
bdd: Improve :inspector tests.
2016-01-07 07:12:51 +01:00
Florian Bruhin
ab22b7740f
bdd: Add test for :follow-selected --tab with JS.
2016-01-06 23:29:16 +01:00
Florian Bruhin
c9a35e7f1e
bdd: Add a test for :follow-selected --tab
2016-01-06 23:24:17 +01:00
Florian Bruhin
7cc98a1248
Fix lint.
2016-01-06 23:19:44 +01:00
Florian Bruhin
16ec035418
bdd: Handle trailing slash for URLs loaded.
...
For some reason, older Qt versions (Debian Jessie/Ubuntu Trusty) like to add a
/, so we need to handle that case too.
2016-01-06 23:19:04 +01:00
Florian Bruhin
a2c3f8c402
bdd: Add some tests for :follow-selected.
2016-01-06 22:59:42 +01:00
Florian Bruhin
916b294976
bdd: Fix regex escape.
...
The . chars weren't properly escaped.
2016-01-06 22:59:05 +01:00
Florian Bruhin
7dc03710b1
bdd: Only check logs for "... should be loaded".
...
Checking the requests from the webserver proved problematic, as often there's
some kind of caching going on. Instead, we only check the log, as this is used
for things like :navigate anyways, so if the log says the page got loaded, we
can trust it.
There's still "... should be requested" to check the actual requests.
2016-01-06 22:57:49 +01:00
Florian Bruhin
b1bf75f069
bdd: Add a test for :drop-selection.
2016-01-06 22:15:13 +01:00
Florian Bruhin
2d9900a5ad
bdd: Add test for :paste with invalid URL.
2016-01-06 22:07:19 +01:00
Florian Bruhin
bd611b7ee4
bdd: Skip :print test.
...
This sometimes seem to cause the following warning:
QPainter:🔚 Painter ended with 2 saved states
2016-01-06 18:27:14 +01:00
Florian Bruhin
275f1ede82
bdd: Add test for :undo.
2016-01-06 18:27:14 +01:00
Florian Bruhin
4bb38f1488
bdd: Handle some more corner cases in commands.py.
2016-01-06 18:27:14 +01:00
Florian Bruhin
4099a40e35
Fix lint.
2016-01-06 08:50:22 +01:00
Florian Bruhin
d2a1282c0b
tests: Split up testprocess.wait_for.
2016-01-06 08:49:30 +01:00
Florian Bruhin
b1b767ed96
tests: Don't start Xvfb for unittests-nodisp.
2016-01-06 08:36:40 +01:00
Florian Bruhin
b0f001d3f1
Skip :print test when window can't be focused.
...
For some reason the window doesn't get focused on Travis. If that happens,
let's just skip the test instead of failing it.
2016-01-06 08:29:53 +01:00
Florian Bruhin
29dd6af976
tests: Optionally skip a test when waiting for log.
2016-01-06 08:29:46 +01:00
Florian Bruhin
6a97e98007
Fix lint.
2016-01-06 07:55:42 +01:00
Florian Bruhin
02e30873e1
Only test :print on Linux.
2016-01-06 07:54:54 +01:00
Florian Bruhin
fc755c104b
bdd: Add test for exception with :pyeval.
2016-01-06 07:42:33 +01:00
Florian Bruhin
03ebdfd641
bdd: Add tests for :pyeval.
2016-01-06 07:15:42 +01:00
Florian Bruhin
677dcd6748
bdd: Add tests for :print.
2016-01-06 07:15:34 +01:00
Florian Bruhin
2cadac6b6e
bdd: Add tests for :stop/:reload with wrong count.
2016-01-06 07:15:20 +01:00
Florian Bruhin
e2994e9375
bdd: Add "the page should contain the plaintext".
2016-01-06 07:15:06 +01:00
Florian Bruhin
1619b89df7
pytest: Add a skip mark for use with bdd.
2016-01-06 07:14:30 +01:00
Florian Bruhin
f943891ce6
Fix :reload test when :stop is skipped.
...
I don't know why, but :stop being skipped causes something to be cached with
hello2.txt.
2016-01-05 22:46:52 +01:00
Florian Bruhin
0ce9b28da7
Skip :stop test on OS X.
...
This triggers the OS X kernel bug explained here:
https://bitbucket.org/cherrypy/cherrypy/pull-requests/117/
Fixes #1183 .
2016-01-05 20:13:25 +01:00
Florian Bruhin
8bd4d3d24a
Release v0.5.0
2016-01-05 19:30:50 +01:00
Florian Bruhin
d75ee78845
Clean up pdfjs tests.
2016-01-05 18:47:50 +01:00
Florian Bruhin
88d28e690e
Add pdf.js version to qute:version.
2016-01-05 18:47:50 +01:00
Florian Bruhin
a97ba9aa09
Merge branch 'pdfjs' of https://github.com/Kingdread/qutebrowser into Kingdread-pdfjs
2016-01-05 07:21:26 +01:00
Florian Bruhin
705d77abfb
Also handle the doc path not existing at all.
2016-01-04 20:36:15 +01:00
Florian Bruhin
20faecc7a0
Also handle inexistant doc path.
2016-01-04 20:35:16 +01:00
Florian Bruhin
ea182934f3
Update docs for :help tests.
2016-01-04 20:10:17 +01:00
Florian Bruhin
a5f2ac5f03
Adjust copyright years.
2016-01-04 07:12:39 +01:00
Florian Bruhin
c1d3a94936
Don't pass through shifted characters.
...
See #1207 - turns out that was a problem for *any* character.
2016-01-04 07:10:23 +01:00
Florian Bruhin
81e1c72588
pylint: unneeded-suppression -> useless-suppression
2015-12-21 10:02:43 +01:00
Florian Bruhin
168f65b1a4
tests: Use caplog.at_level, not atLevel.
2015-12-21 09:52:33 +01:00
Florian Bruhin
9101046fe5
tests: Adjust error message comparison for Windows.
2015-12-21 09:51:25 +01:00
Florian Bruhin
95e67bba7b
Suppress pylint no-member for os.mkfifo.
2015-12-21 09:47:20 +01:00
Florian Bruhin
9f64dfb3b6
Skip all tests using py_proc when frozen.
2015-12-21 09:46:30 +01:00
Florian Bruhin
4b770f4f35
tests: Try to work around race condition.
2015-12-21 08:55:55 +01:00
Florian Bruhin
59c8e5c3d1
Add some tests for commands.userscripts.
2015-12-21 08:45:46 +01:00
Daniel Schadt
7944217da4
Adjust pdfjs unit tests for new logging level
...
The script generation output was changed because we changed the logging
level, this adjusts the unit tests to match the new output.
2015-12-20 20:14:17 +01:00
Florian Bruhin
2b1622b34d
Update to pytest-bdd 2.16.0.
...
This avoids deprecation warnings emitted by python 3.5 and pytest 2.8.
2015-12-20 20:11:49 +01:00
Daniel Schadt
6d02ef68ec
Add BDD tests for pdfjs integration
2015-12-20 20:00:56 +01:00
Daniel Schadt
f2ed14a24a
Add unit tests for browser.pdfjs
2015-12-20 19:24:41 +01:00
Daniel Schadt
0811418746
pdfjs: don't embed data in html
...
We don't need more than one copy of the pdf.
2015-12-20 19:24:41 +01:00
Daniel Schadt
dc9cd47afc
pdfjs: add unittest for script generation
2015-12-20 19:24:41 +01:00
Florian Bruhin
fc3a3ea8c6
Add missing not_frozen mark in test_guiprocess.
...
This should fix test failures when frozen.
2015-12-20 18:40:57 +01:00
Florian Bruhin
fcf94fd527
Remove various deprecated commands/arguments.
2015-12-20 18:38:29 +01:00
Florian Bruhin
6b89eb43a2
Allow any non-space char in search engine names.
...
Closes #1189 .
2015-12-20 17:22:54 +01:00
Florian Bruhin
5c769d8000
Report stdout/stderr of failed subprocesses.
2015-12-18 21:23:33 +01:00
Florian Bruhin
d3dc90cb2a
Revert "tests: Use urllib to load redirect-later-continue."
...
This reverts commit 1e43b882ae
.
Seems like this causes other trouble (the redirect-later request missing?!)
2015-12-18 20:24:03 +01:00
Florian Bruhin
1e43b882ae
tests: Use urllib to load redirect-later-continue.
...
This might avoid the EPROTOTYPE bug on OS X. See #1183 .
2015-12-18 19:57:15 +01:00
Florian Bruhin
b3e4ac8043
tests: Fix AttributeError in _wait_for_clipboard.
2015-12-18 07:18:27 +01:00
Florian Bruhin
45d6dc6aa3
tests: Hopefully fix keyinput.feature flakiness.
...
While the original "no focused webview" bug (with the first test after spawning
qutebrowser) from #1183 was fixed, we still had a case where the next test
after ":fake-key sending key to the website with other window focused" failed,
presumably because the inspector was still focused, e.g. here:
http://qutebrowser.org:8010/builders/osx/builds/1175/steps/tests/logs/stdio
This hopefully fixes this by properly waiting until the inspector is gone.
2015-12-18 07:13:16 +01:00
Florian Bruhin
172157ed0d
Remove unused import, take two.
2015-12-17 23:09:11 +01:00
Florian Bruhin
a7dee6c053
Remove unused import.
2015-12-17 22:57:16 +01:00
Florian Bruhin
fc84e58043
tests: Ignore "SelectionRequest too old" globally.
...
If we use pytestmark, it won't be ignored inside subprocess output, so our fix
from https://github.com/The-Compiler/qutebrowser/issues/1124#issuecomment-158073581
never actually worked.
See #1124 and #1183 .
2015-12-17 22:33:07 +01:00
Florian Bruhin
8786e979a6
tests: Wait for data in the clipboard.
...
This should hopefully stabilize the flaky clipboard tests.
See #1183 .
2015-12-17 22:17:38 +01:00
Florian Bruhin
e78d2a8399
tests: Check args for loadFinished signals.
2015-12-17 07:49:28 +01:00
Florian Bruhin
c1951a8f15
tests: Get rid of QSignalSpy where we can.
2015-12-17 07:49:28 +01:00
Florian Bruhin
982e78249a
tests: Clear captured output between tests.
2015-12-16 23:07:42 +01:00
Florian Bruhin
a157f822d6
tests: Handle report.longrepr being a tuple.
...
For some unknown reason, report.longrepr.addsection might not exist, which
caused failures on OS X and Windows. If that happens, we just don't add a
section at all.
2015-12-16 22:47:33 +01:00
Florian Bruhin
e6284ed5d4
tests: Improve some ugly test IDs.
2015-12-16 22:21:29 +01:00
Florian Bruhin
bba6589e19
Capture qutebrowser/httpbin output separately.
...
When using print and relying on pytest to capture it as stdout, we ran into
this pytest/pytest-qt issue:
https://github.com/pytest-dev/pytest-qt/issues/113
Now we use our own capturing mechanism instead, which also means we get nicer
output.
Fixes #1122 .
2015-12-16 21:25:13 +01:00
Florian Bruhin
7f83c6c5c8
pylint: Disable no-member for hypothesis.Settings.
...
hypothesis.Settings.default is probably created dynamically.
2015-12-15 18:57:14 +01:00
Florian Bruhin
4a58e10e09
Enable hypothesis' strict mode.
2015-12-15 18:09:52 +01:00
Florian Bruhin
fd96685b02
tests: Wait until the qutebrowser window has focus.
...
This should fix the second case in #1183 and other related flakiness in
keyinput.feature.
2015-12-15 07:43:14 +01:00
Florian Bruhin
49be07eb18
Add config read in test_default_config.
...
For some reason this was failing on OS X/Travis otherwise?
2015-12-11 22:17:51 +01:00
Florian Bruhin
d267cbd44f
tests: Require qapp for test_old_config.
2015-12-11 18:16:46 +01:00
Florian Bruhin
202bf59edc
Add tests for renamed/deleted config options.
...
See #1171 .
2015-12-11 08:50:26 +01:00
Florian Bruhin
ec06247327
Add tests to check upgrades from old configs.
...
See #1171 .
2015-12-11 08:50:26 +01:00
Florian Bruhin
10dd1b50b9
Split ConfigManager.read from constructor.
2015-12-11 08:50:26 +01:00
Corentin Julé
ff8d5370a3
Add ideas for improvement
2015-12-08 10:37:04 +01:00
Corentin Julé
99ede3f551
Improve coverage and code cleanup
2015-12-08 00:52:51 +01:00
dylan araps
1bc8d10ac7
Added config option to change tab title alignment
2015-12-07 19:43:43 +11:00
Corentin Julé
f8fcd48998
remove now useless tests
2015-12-07 00:11:19 +01:00
Corentin Julé
6be0ff67f7
Replace some tests with a generic host blocking list
2015-12-07 00:09:51 +01:00
Corentin Julé
a24a7790cd
Improve code readability
2015-12-06 19:33:35 +01:00
Corentin Julé
8bff518ba4
Refactor and add tests
2015-12-06 15:35:10 +01:00
Corentin Julé
ac3d0b9a4c
Comply with pylint
2015-12-06 00:51:44 +01:00
Corentin Julé
1ba634969a
Correct QUrl creation
2015-12-06 00:42:33 +01:00
Corentin Julé
472585edd5
Add tests for HostBlocker class
2015-12-06 00:10:56 +01:00
Corentin Julé
9da15ae2f9
Correct is_whitelisted_host test
2015-12-05 12:41:52 +01:00
Corentin Jule
d55e6d7d7e
Comply with PEP257
2015-12-05 01:35:20 +01:00
Corentin Jule
cc946ba6e6
implementation of config_stub fixture
2015-12-05 01:09:11 +01:00
Corentin Jule
8222a86201
Remove useless test
2015-12-05 00:16:38 +01:00
Corentin Jule
3426dd06f6
Add some docstrings
2015-12-04 21:57:34 +01:00
Corentin Jule
95b200ead9
Pylint code cleanup
2015-12-04 01:52:00 +01:00
Corentin Jule
8dd0249af9
Code cleanup - Pep8
2015-12-03 22:00:39 +01:00
Corentin Jule
2d850f7106
Add tests for first functions of adblock.py
2015-12-03 21:12:51 +01:00
Florian Bruhin
e68965fea2
bdd: Wait for help pages to be loaded in tests.
...
This hopefully fixes #1150 .
2015-12-02 22:22:31 +01:00
Florian Bruhin
4170e3c9af
bdd: Simplify qute:settings test.
2015-12-02 22:19:43 +01:00
Florian Bruhin
d418f7f9fa
Merge branch 'caret_mode_windows_osx' of https://github.com/artur-shaik/qutebrowser into artur-shaik-caret_mode_windows_osx
2015-12-02 06:22:27 +01:00
Panagiotis Ktistakis
6e8ac374dd
Add tests for :tab-move wrapping.
2015-12-02 03:35:25 +02:00
Panagiotis Ktistakis
de3460da3e
Wrap tabs on :tab-move +/- if tabs->wrap is true.
2015-12-02 03:17:54 +02:00
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