Commit Graph

324 Commits

Author SHA1 Message Date
Antoni Boucher
e5779d0775 Fixed tests. 2015-08-08 19:32:47 -04:00
Antoni Boucher
a6010e3ead Renamed test function. 2015-08-08 15:40:18 -04:00
Antoni Boucher
14ae308279 Added a file:// scheme. 2015-08-08 15:16:48 -04:00
Antoni Boucher
2969599390 Use toLocalFile function instead of slicing. 2015-08-08 14:13:09 -04:00
Antoni Boucher
e6521b047d Added get_file_list function and tests. 2015-08-08 14:10:27 -04:00
Antoni Boucher
b8809f879d Added resource_filename function and tests. 2015-08-08 13:47:47 -04:00
Daniel
bb6d6e51f6 Remove trailing whitespace in test_urlutils.py 2015-08-08 13:59:43 +02:00
Daniel
72c65a812f Move incdec_number tests to own class
and add tests for numbers in anchors
2015-08-08 13:47:17 +02:00
Daniel
9e98ab181a Add URL validity check + tests to incdec_number 2015-08-08 00:57:16 +02:00
Daniel
c4c3a83ac0 rename url_incdec_number to incdec_number 2015-08-08 00:57:16 +02:00
Daniel
276b163e0d Move logic from _navigate_incdec to urlutils
Also add unittests for url_incdec_number
2015-08-07 18:48:07 +02:00
Florian Bruhin
01f71e980d pylint: Ignore import-error. 2015-08-07 00:16:37 +02:00
Florian Bruhin
8aab87e2a2 Don't readd capturelog handler after log tests.
I don't really know why, but doing that ends up with something calling
sys.stdout.close()...

Fixes #856.
2015-08-07 00:09:02 +02:00
Florian Bruhin
aa1ea9b063 Use parametrization for TestKeyToString:test_all.
This generates a lot of tests, but is more stable than our current approach.
2015-08-06 23:43:53 +02:00
Florian Bruhin
5ccdec4162 Add comment about Qt warning. 2015-08-06 23:19:05 +02:00
Florian Bruhin
0a16f29bd1 Hexlify strings in TestJavascriptEscape. 2015-08-04 23:12:40 +02:00
Florian Bruhin
0ce9ae070c Add some more test cases for TestJavascriptEscape. 2015-08-04 12:42:49 +02:00
Florian Bruhin
43266ac08a webelem: Add more tests. 2015-08-03 23:40:39 +02:00
Florian Bruhin
c0941ab19b Add more webelem tests. 2015-08-02 23:49:22 +02:00
Florian Bruhin
982a6eccfb Rewrite tests/browser/test_webelem.py for pytest. 2015-08-02 22:16:03 +02:00
Florian Bruhin
e5056e1c43 100% coverage for mainwindow.statusbar.tabindex. 2015-08-02 20:34:37 +02:00
Florian Bruhin
2190316b27 Fix lint. 2015-08-02 20:16:28 +02:00
Florian Bruhin
f8f03ea99d Small simplification in test_http_hypothesis. 2015-08-02 20:14:39 +02:00
Florian Bruhin
07641830ae Add hypothesis tests for http/rfc6266.
See #830.
2015-08-02 20:12:10 +02:00
Florian Bruhin
25d1064aee Add some more rfc6266 tests. 2015-08-02 19:39:05 +02:00
Florian Bruhin
33915b65cf Test getting path without Content-Disposition. 2015-08-02 17:19:20 +02:00
Florian Bruhin
359b886ba0 Small style fixes for test_content_disposition. 2015-08-02 14:07:28 +02:00
Florian Bruhin
b2cb9d6d46 Add hypothesis tests for misc.split.
See #830.
2015-08-02 13:40:24 +02:00
Florian Bruhin
59460035c5 Add simple_split() test with maxsplit=0 and keep. 2015-08-02 13:20:30 +02:00
Florian Bruhin
9318173dc8 Test ShellLexer with empty input. 2015-08-02 13:02:32 +02:00
Florian Bruhin
dacf2cace2 Fix line length. 2015-08-02 01:57:16 +02:00
Florian Bruhin
49f017c0dd Fix mainwindow.statusbar.percentage tests. 2015-08-02 01:53:30 +02:00
Florian Bruhin
fc09d63eb1 Fix lint. 2015-08-02 01:46:32 +02:00
Florian Bruhin
f21cffd9b8 100% coverage for mainwindow.statusbar.percentage. 2015-08-02 01:45:19 +02:00
Florian Bruhin
9db0e03f05 Add some tests for config.configexc. 2015-08-02 01:31:43 +02:00
Florian Bruhin
e94e90baec Add some tests for config.configdata. 2015-08-02 00:59:13 +02:00
Florian Bruhin
26f6bb7d0d Rewrite browser.test_tabhistory.py for pytest. 2015-08-02 00:34:04 +02:00
Florian Bruhin
0e25f5c730 Use a fake process for test_cmd_args.
This should fix the teardown exception (because the message module is not
patched anymore) with the new pytest-qt version.
2015-08-01 23:50:29 +02:00
Florian Bruhin
52d7a5693f Fix lint. 2015-08-01 13:47:42 +02:00
Florian Bruhin
fa131e3290 Test urlutils.same_domain with invalid URLs. 2015-08-01 13:45:51 +02:00
Florian Bruhin
336b7de6d4 Clean up same_domain tests. 2015-08-01 13:23:03 +02:00
Florian Bruhin
27f65be860 Merge branch 'referer-header' of https://github.com/Carpetsmoker/qutebrowser into Carpetsmoker-referer-header
Conflicts:
      tests/utils/test_urlutils.py
2015-08-01 12:44:57 +02:00
Florian Bruhin
451477593f Always require 4 values for padding. 2015-08-01 00:34:09 +02:00
Florian Bruhin
452c4115d3 Add a Padding config type. 2015-07-31 15:38:41 +02:00
Florian Bruhin
c750ff3f50 configtypes: Handle invalid format syntax. 2015-07-26 13:56:46 +02:00
Florian Bruhin
4bdf00b148 configtypes: Handle {1} correctly. 2015-07-26 13:56:40 +02:00
Florian Bruhin
694fbe053d Fix lint. 2015-07-24 18:11:52 +02:00
Florian Bruhin
44bf4ae883 configtypes: Fix ' ' value with Command. 2015-07-24 17:56:12 +02:00
Florian Bruhin
ebdfa0be73 Add hypothesis tests for configtypes.
See #830.
2015-07-24 17:49:09 +02:00
Florian Bruhin
b19852b6e7 configtypes: Add _basic_validation() to BaseType.
This has a few implications:

- Checking for empty/none_ok is now easier as _basic_validation() does this.
- To make things easier, WebKitBytes and WebKitBytesList now need to have
  none_ok passed as well instead of assuming True.
- _basic_validation() checks for unprintable chars and raises ValidationError
  if they occur, so this gets checked for all types.
2015-07-24 17:39:02 +02:00
Florian Bruhin
dfba381b57 Fix broken utils.version test. 2015-07-24 13:53:26 +02:00
Florian Bruhin
5643b14987 configtypes: Add test for UserAgent.complete(). 2015-07-24 00:29:12 +02:00
Florian Bruhin
cc6602926f configtypes: Add tests for ConfirmQuit. 2015-07-24 00:24:17 +02:00
Florian Bruhin
b3755f4ca1 configtypes: Add tests for SessionName. 2015-07-24 00:11:52 +02:00
Florian Bruhin
e145d73852 configtypes: Add a MappingType base class. 2015-07-24 00:11:52 +02:00
Florian Bruhin
0b1704d829 configtypes: Add a __repr__ to ValidValues. 2015-07-24 00:11:52 +02:00
Florian Bruhin
8f48247b8f configtypes: Add invalid URL for TestUrlList. 2015-07-24 00:11:52 +02:00
Florian Bruhin
71188bb67b configtypes: Simplify UrlList tests. 2015-07-23 23:14:20 +02:00
Florian Bruhin
e4c7e70aba configtypes: Fix ColorTests parametrization. 2015-07-23 21:33:16 +02:00
Florian Bruhin
fb6bf5c34f configtypes: Change tests to not subclass. 2015-07-23 20:55:27 +02:00
Florian Bruhin
41333cd6e1 configtypes: Add some additional tests. 2015-07-23 16:58:21 +02:00
Florian Bruhin
eb28365d82 configtypes: Add os.path.join emulation to os_mock. 2015-07-23 16:57:42 +02:00
Florian Bruhin
cf5296ebb5 configtypes: Fix broken Command test. 2015-07-23 14:41:29 +02:00
Florian Bruhin
75991e1f87 configtypes: Add tests for BoolAsk. 2015-07-23 14:41:14 +02:00
Florian Bruhin
23583b7d48 Refactor test_configtypes for pytest. 2015-07-23 12:37:14 +02:00
Florian Bruhin
a02055414d Make command tests work. 2015-07-20 11:23:34 +02:00
Florian Bruhin
e5843ffcf6 Command tests WIP 2015-07-19 21:56:23 +02:00
Florian Bruhin
ca5a78dfc7 Attach numerical code to Qt OSErrors and fix tests.
This fixes tests with tox < 2.0.0 on systems with a non-english locale, as it's
no longer the errorString which gets compared.

Fixes #806.
2015-07-12 11:20:28 +02:00
Florian Bruhin
0037b0db7e Actually run OS X tests on OS X. 2015-07-11 20:14:26 +02:00
Florian Bruhin
e010d3dabc Fix os.path patching in tests.
Fixes #802.
2015-07-06 18:50:34 +02:00
Florian Bruhin
20ff7e702a Increase all test_guiprocess timeouts.
Windows is fscking slow...
2015-07-06 18:04:54 +02:00
Florian Bruhin
c5b75b0b16 Merge remote-tracking branch 'origin/usertypes-tests' 2015-07-06 17:58:13 +02:00
Florian Bruhin
382b52a0b8 Merge remote-tracking branch 'origin/urlutils-tests' 2015-07-06 17:58:06 +02:00
Florian Bruhin
cef350ad66 tests: Use multiple pytest.mark.parametrize calls. 2015-07-06 17:56:13 +02:00
Florian Bruhin
a0a7f9feda Skip test_file_absolute_expanded on Windows. 2015-07-06 17:22:52 +02:00
Florian Bruhin
3f13c2bd3e Add/improve tests for qutebrowser.utils.urlutils. 2015-07-06 17:10:57 +02:00
Florian Bruhin
aa1bf00274 Add tests for usertypes.Question. 2015-07-06 14:34:47 +02:00
Florian Bruhin
1533108ca6 Add tests for usertypes.Timer. 2015-07-02 21:10:56 +02:00
Florian Bruhin
b02867fe37 Improve enum tests. 2015-07-02 21:10:56 +02:00
Florian Bruhin
4e0d00098c Improve NeighborList tests. 2015-07-02 21:10:56 +02:00
Florian Bruhin
1672399252 Remove unused imports. 2015-06-28 23:20:56 +02:00
Florian Bruhin
9b264c7514 tests: Share common markers. 2015-06-28 22:58:48 +02:00
Martin Tournoij
a346644c71 Changed:
- same_domain: If the tld is unknown, only return True if the hostnames are the same
- Fix when starting without an open page
2015-06-27 21:15:54 +02:00
Martin Tournoij
f806eefba6 Merge branch 'master' into referer-header 2015-06-27 20:43:54 +02:00
Florian Bruhin
6dbac1c047 Rewrite version.version() tests and test short arg. 2015-06-26 22:37:00 +02:00
Florian Bruhin
75b894a186 Include DESKTOP_SESSION in qute:version. 2015-06-24 20:54:37 +02:00
Florian Bruhin
220ac021f0 Print style name in version info. 2015-06-24 20:37:48 +02:00
Florian Bruhin
24424a0486 Fix expected qWarning messages for Qt 5.5. 2015-06-24 20:30:26 +02:00
Florian Bruhin
db267ae195 tests: Increase timeout for starting processes.
Windows can be slow...
2015-06-24 18:32:56 +02:00
Florian Bruhin
b7c3e7b959 Disallow {foo} in search engine URLs.
This causes an KeyError otherwise when trying to use str.format to insert the
search term.
2015-06-24 07:46:15 +02:00
Florian Bruhin
a5610fd6da Fix TestReadFile when frozen. 2015-06-19 09:40:26 +02:00
Florian Bruhin
85f6b3c6df Fix TestGitStr when frozen. 2015-06-19 09:40:26 +02:00
Florian Bruhin
08c8a5f7dd Skip tests which need sys.executable when frozen.
See #770
2015-06-19 09:40:26 +02:00
Florian Bruhin
3de1299650 tests: Use utils.read_file to get javascript files.
This will make those tests pass when frozen.

See #770.
2015-06-18 21:09:10 +02:00
Florian Bruhin
b1334bcc22 Use repr() for unknown objects in utils.qualname. 2015-06-17 06:46:03 +02:00
Florian Bruhin
219c2f8ae8 Ignore "Unable to set geometry" warnings in tests.
This reverts commits 9b066ec50a and
83f7cf84a9.

This was still broken even after setting the geometry:

https://ci.appveyor.com/project/The-Compiler/qutebrowser
2015-06-12 17:04:12 +02:00
Florian Bruhin
8033931bae Test key_to_string with all Qt.Key members. 2015-06-12 16:37:07 +02:00
Florian Bruhin
9b066ec50a Set geometry in test_textbase.py.
See 83f7cf84a9 - it seems with the Qt 5.4.2
upgrade there are some more warnings on Windows.
2015-06-12 13:44:10 +02:00
Florian Bruhin
e8830a631e Increase test_guiprocess timeouts.
Apparently 1 second is not enough for Windows to start a process...
2015-06-12 11:54:20 +02:00
Florian Bruhin
425fcdf8e4 Merge branch 'util-tests-1' 2015-06-12 11:50:57 +02:00
Florian Bruhin
36a2f4a15a Fix newline stripping. 2015-06-11 23:14:56 +02:00
Florian Bruhin
fc32858e5c Add GUIProcess tests. 2015-06-11 23:05:57 +02:00
Florian Bruhin
1956158096 Make keyword arguments work for MessageModule stub. 2015-06-11 23:03:15 +02:00
Florian Bruhin
fc5349e1dc Change FakeQProcess stub to a function with spec. 2015-06-11 23:02:18 +02:00
Florian Bruhin
ad401e035f Proxy QProcess signals. 2015-06-11 20:30:37 +02:00
Florian Bruhin
1f67353a40 Adjust editor tests for GUIProcess. 2015-06-11 20:30:28 +02:00
Florian Bruhin
163bc2e12e Add GUIProcess.
This aims to unify the code which spawns a process and then shows statusbar
notifications when it exited, etc.
2015-06-11 20:30:03 +02:00
Florian Bruhin
3e8a394217 Disable no-member for pylint for os.SEEK_*.
This should fix pylint on Windows.
2015-06-11 10:49:06 +02:00
Florian Bruhin
480c4e878e Ignore pylint warning on Ubuntu/Travis. 2015-06-11 10:26:18 +02:00
Florian Bruhin
171a0f201b Merge branch 'relapaths' of https://github.com/lamarpavel/qutebrowser into lamarpavel-relapaths 2015-06-08 18:48:11 +02:00
Lamar Pavel
7f27c183be Include expandvars in File.validate
I thought I put this in here before, but apparently I did not. So here it is,
together with a new test to verify it. Other tests needed to be updated with a
mock for os.path.expandvars.
2015-06-08 13:18:16 +02:00
Florian Bruhin
c08078841f Fix test_qprocess. 2015-06-08 07:49:22 +02:00
Florian Bruhin
1fcce12870 Fix TestPyQIODevice.failing_open on Windows. 2015-06-08 07:45:19 +02:00
Florian Bruhin
00747be9d3 Fix TestSavefileOpen.test_existing_dir on older Qt. 2015-06-08 07:43:40 +02:00
Florian Bruhin
261c44bea9 Fix TestPyQIODevice.test_qprocess on Windows. 2015-06-08 07:42:17 +02:00
Florian Bruhin
1e982a9a84 Add/improve tests for qutebrowser.utils.qtutils. 2015-06-07 23:20:34 +02:00
Florian Bruhin
e60f698615 Add/improve tests for qutebrowser.utils.standarddir. 2015-06-07 23:20:34 +02:00
Florian Bruhin
df53ccf426 Write tests for qutebrowser.utils.version. 2015-06-07 23:20:34 +02:00
Florian Bruhin
4204579c06 Add/improve tests for qutebrowser.utils.utils. 2015-06-07 22:53:30 +02:00
Florian Bruhin
83f7cf84a9 tests: Set progress widget geometry.
This hopefully fixes this warning on Windows:

    QWindowsWindow::setGeometryDp: Unable to set geometry 113x16+192+124 on
    QWidgetWindow/'ProgressClassWindow'. Resulting geometry:  124x16+192+124
    (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 0x0, maximum
    size: 16777215x16777215).
2015-06-07 11:14:14 +02:00
Florian Bruhin
e98a05e53d Fix scroll_anchor in javascript tests.
It seems scrollRequested doesn't actually get emitted.
2015-06-07 10:38:58 +02:00
Florian Bruhin
e86a79740a Use raising=True for QtBot.waitSignal. 2015-06-07 02:30:36 +02:00
Florian Bruhin
aa4cb2927d Fix TestHideQtWarning tests for pytest 1.4.0.
pytest captures the Qt logging messages, so we can't use qWarning to test.
2015-06-07 02:29:20 +02:00
Florian Bruhin
2117b2afc6 Revert "Skip test which might be responsible for segfaults."
This reverts commit 592ace18d4.
2015-06-07 01:25:10 +02:00
Martin Tournoij
463e85ff5d Add referer-header setting, #712 2015-06-05 18:00:21 +02:00
Florian Bruhin
8001099661 Adjust tests. 2015-06-05 17:45:32 +02:00
Lamar Pavel
402aa66756 Merge branch 'master' of github.com:The-Compiler/qutebrowser 2015-06-05 16:10:55 +02:00
Florian Bruhin
9ec6e6da80 Fix exit status codes to be 0-based. 2015-06-04 15:13:20 +02:00
Florian Bruhin
592ace18d4 Skip test which might be responsible for segfaults. 2015-06-01 22:32:11 +02:00
Florian Bruhin
7daf1cb239 Merge branch 'rltests' 2015-06-01 09:03:06 +02:00
Lamar Pavel
f5d299d8c7 Fix intents 2015-05-28 13:05:12 +02:00
Lamar Pavel
b5eea81e2e Fix File.validate and corresponding tests
There were no tests regarding the return value of standarddir.config() and thus
it wasn't caught that it returned None in some cases. This is now fixed by
checking the return of standdarddir.config before calling it and modifying the
corresponding test_validate_exists_rel as well as adding a new
test_validate_rel_config_none.
2015-05-28 12:14:12 +02:00
Lamar Pavel
4851a3d442 Replace isabs with exists in transform
In UserStyleSheet.transform os.path.isabs was replaced with os.path.exists, a
more fitting condition. Accordingly two test cases needed to include mocks for
os.path.exists and QUrl.fromLocalFile.
2015-05-27 15:39:58 +02:00
Lamar Pavel
e12dce9d55 Include expandvars in File.transform, adjust test 2015-05-27 14:40:07 +02:00
Lamar Pavel
cfae36c5c8 Adjust name and doc of modified test 2015-05-27 14:05:29 +02:00
Lamar Pavel
f326fa28a6 Merge branch 'master' into relapaths
Sync with upstream/master before creating a pull request
2015-05-27 11:57:13 +02:00
Florian Bruhin
ddf86600d1 tests: Rename Testable* classes.
This hides some pytest warnings as it tried to collect those classes.
2015-05-27 07:51:53 +02:00
Lamar Pavel
f1129460d8 Class File now validates relative paths
The code from function validate in class UserStyleSheet has been migrated to
class File. One test had to be modified due to different expected behaviour.
2015-05-26 13:54:27 +02:00
Florian Bruhin
0f13d9325b Don't use parametrization for deprecated keys.
This showed up as 2400 tests for what basically is one.
2015-05-25 01:26:52 +02:00
Florian Bruhin
341708f543 Refactor readline tests.
They now use a real QLineEdit and verify a lot more.

See #660, #678.
2015-05-19 12:36:07 +02:00
Florian Bruhin
069d7b26a2 pytest: Use common fixture for fake_keyconfig. 2015-05-19 07:46:56 +02:00
Florian Bruhin
98d1fca220 Use monkeypatch instead of mocker in some tests.
See #660.
2015-05-18 23:32:01 +02:00
Florian Bruhin
beb970d7d5 Strip whitespace for position_caret tests.
It seems on Windows, QWebPage.SelectNextWord includes the trailing space. This
should fix those tests on Windows.
2015-05-18 23:04:11 +02:00
Florian Bruhin
b650ec75f3 Merge branch 'visual' 2015-05-18 22:25:03 +02:00
Florian Bruhin
8941b5dc96 Merge branch 'visual' 2015-05-18 21:43:25 +02:00
Florian Bruhin
8e417970c3 Merge branch 'pytest-rewrites' 2015-05-18 21:42:15 +02:00
Florian Bruhin
54eae77328 Fix tests on OS X, take three. 2015-05-17 19:04:07 +02:00
Florian Bruhin
81ba49e79b Fix tests on OS X, take two. 2015-05-17 18:59:40 +02:00
Florian Bruhin
a9f5d45c34 Fix tests on OS X. 2015-05-17 18:52:55 +02:00
Florian Bruhin
54131e9d3e Add --basedir arg with multiple instance support.
Closes #510.
2015-05-16 23:10:20 +02:00