Commit Graph

4623 Commits

Author SHA1 Message Date
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
Florian Bruhin
aab5411317 Fix test function name. 2015-05-16 23:06:33 +02:00
Florian Bruhin
42c27ddbc0 Use temp dir for standarddir arg tests. 2015-05-16 22:30:00 +02:00
Florian Bruhin
c762340a0c Add --datadir/--cachedir arguments. Closes #136. 2015-05-16 22:12:27 +02:00
Florian Bruhin
7e2c67a7e4 Fix tests/lint. 2015-05-15 20:25:29 +02:00
Florian Bruhin
f49dba6e38 Use fake key events for scrolling.
Closes #669.
Fixes #218.

See #246, #534.
2015-05-15 19:02:33 +02:00
Florian Bruhin
f8f8699ab8 Fix key config migration for rapid hinting. 2015-05-13 10:45:20 +02:00
Florian Bruhin
5d13d0073c Add some tests for key config migrations. 2015-05-13 10:41:23 +02:00
Florian Bruhin
25005ded8a Add a test for deprecated default bindings. 2015-05-13 08:26:19 +02:00
Florian Bruhin
e35d284282 Remove blank line. 2015-05-13 06:32:09 +02:00
Florian Bruhin
9fde38d96a Reset CaretBrowsingEnabled to original value. 2015-05-13 06:31:48 +02:00
Florian Bruhin
2775f2b2ee Add some more tests. 2015-05-12 19:15:27 +02:00
Florian Bruhin
7edfdaa271 Add test for invisible elements. 2015-05-12 19:08:54 +02:00
Florian Bruhin
2b440bc8db Handle QWebPage javascript methods. 2015-05-12 17:44:06 +02:00
Florian Bruhin
27a34d5499 Close anchor. 2015-05-12 17:32:33 +02:00
Florian Bruhin
aa2e5a35d6 Add javascript tests for position_caret.js. 2015-05-12 17:05:01 +02:00
Florian Bruhin
756aa3e16f Fix tests because of new '0' key handling. 2015-05-11 21:10:18 +02:00
Florian Bruhin
452e03f9af Rewrite test_lineparser.py to use pytest.
See #660.
2015-05-10 16:19:30 +02:00
Florian Bruhin
db0a54b03f Rewrite test_crashdialog.py to use pytest.
See #660.
2015-05-10 16:19:30 +02:00
Florian Bruhin
392fb3e1d7 Rewrite test_neighborlist.py to use pytest.
See #660.
2015-05-10 16:19:30 +02:00
Florian Bruhin
021c94eece Rewrite test_enum.py to use pytest.
See #660.
2015-05-10 16:19:30 +02:00
Florian Bruhin
8398fe3bdd Rewrite test_log.py to use pytest.
See #660.
2015-05-10 16:19:30 +02:00
Florian Bruhin
f9876823b8 Add a new config_stub fixture.
This replaces various other constructs:

- The default_config fixture - this means the config values used by
  test_progress.py are set explicitly and the (rather complex) default config
  is mocked out.

- stubs.ConfigStub which was created by the tests manually before.
2015-05-07 22:56:31 +02:00
Florian Bruhin
7975bd8796 Remove unused import. 2015-05-07 22:55:21 +02:00
Florian Bruhin
903d437943 Fix flaky log_time test. 2015-05-06 11:21:49 +02:00
Florian Bruhin
4925091ede Merge branch 'master' of github.com:The-Compiler/qutebrowser 2015-04-22 07:43:01 +02:00
Florian Bruhin
9f443d026a Make pylint shut up. 2015-04-20 23:12:15 +02:00
Florian Bruhin
a7dfdd48e0 Fix lint. 2015-04-20 22:59:35 +02:00
Bruno Oliveira
69061c5629 Remove LimitLineParser from test
As suggested by @The-Compiler, this is not really necessary
2015-04-20 12:51:36 -03:00
Bruno Oliveira
f55242ad93 Use pytest-mock to install QApplication.clipboard mock 2015-04-19 17:13:47 -03:00
Bruno Oliveira
2d19708a41 Play nice with other plugins in conftest.py
Some plugins might create their own Item subclasses without
a `fixturenames` attribute. Discovered while taking pytest-flakes
for a spin.
2015-04-19 17:11:29 -03:00
Raphael Pierzina
6c97a4a6e0 Remove blank line at end of file to fix flake8 2015-04-19 21:10:27 +02:00
Florian Bruhin
cc738fa846 Make test_log_time less flaky. 2015-04-16 08:58:48 +02:00
Bruno Oliveira
f5e6091ff6 Add tests for CommandLineEdit 2015-04-15 20:22:03 -03:00
Florian Bruhin
987bab9960 Merge pull request #19 from hackebrot/parametrize-sub-tests
Parametrize sub tests
2015-04-14 07:01:53 +02:00
Florian Bruhin
ba678e29fb Fix lint. 2015-04-14 07:00:56 +02:00
Florian Bruhin
10214a8b83 Merge pull request #23 from hackebrot/single-qnam
Use a single QNetworkAccessManager per session.
2015-04-14 07:00:25 +02:00
Bruno Oliveira
6ae94d6f49 Create module overflow_test_cases
As suggested by @The-Compiler
2015-04-13 18:20:40 -03:00
Florian Bruhin
e8ddd9397d Use a single QNetworkAccessManager per session. 2015-04-13 22:34:30 +02:00
Florian Bruhin
a6e3199616 Fix binding of special keys with lower-case mods. 2015-04-13 22:08:57 +02:00
Florian Bruhin
3433a1ec7a Add tests for CommandRunner/KeyConfigParser. 2015-04-13 07:54:24 +02:00
Bruno Oliveira
f4c46ec1c5 Improve test legibility in TestCheckOverflow
Created OverflowTestCases which is responsible to provide data for the tests
2015-04-10 18:22:02 -03:00
Florian Bruhin
3bc55e0405 Merge pull request #20 from hackebrot/validate-key-config
Add a test to validate the default key config.
2015-04-10 08:44:57 +02:00
Raphael Pierzina
0b2e39e4a4 Merge remote-tracking branch 'upstream/master' 2015-04-10 08:40:17 +02:00
Bruno Oliveira
6f1e830aba Parametrize test_str_split_maxsplit
As suggested by @hackebrot
2015-04-09 18:44:40 -03:00
Bruno Oliveira
253f3b2cd7 Use namedtuple and parametrized fixture for TestSplit
As discussed in the PR, this greatly improves legibility
2015-04-09 18:40:56 -03:00
Bruno Oliveira
55e3645131 Add comment to test samples in test_basekeyparser 2015-04-09 18:13:13 -03:00
Florian Bruhin
91b72ef292 Add a test to validate the default key config. 2015-04-09 21:20:17 +02:00
Bruno Oliveira
96ddfd5b65 Parametrize TestSplitCount in test_basekeyparser
As pointed out by @The-Compiler
2015-04-09 07:57:32 -03:00
Florian Bruhin
425cffc2f7 pylint: Ignore 'undefined-variable' for tests.
It's less than optimal, but disabling it selectively because of
https://bitbucket.org/logilab/pylint/issue/511/ is too annoying.
2015-04-09 07:43:47 +02:00
Florian Bruhin
74f4642a2c Fix lint. 2015-04-09 07:35:33 +02:00
Florian Bruhin
a2772db9da Merge pull request #18 from hackebrot/convert-test-jinja
Convert test_jinja.py to pytest
2015-04-09 06:54:21 +02:00
Florian Bruhin
44a6617184 Add docstring for patch_read_file. 2015-04-09 06:53:21 +02:00
Florian Bruhin
343a091aee Small docstring cleanup. 2015-04-09 06:42:34 +02:00
Bruno Oliveira
853280feeb Convert test_qtutils to pytest 2015-04-08 20:25:01 -03:00
Bruno Oliveira
6037fd74cd Convert test_split to pytest 2015-04-08 20:07:14 -03:00
Raphael Pierzina
b18c1254a4 Use an autofixture that monkeypatches read_file for both tests 2015-04-09 00:46:48 +02:00
Raphael Pierzina
c3e615dfa3 Remove the test class from test_jinja.py 2015-04-09 00:38:57 +02:00
Raphael Pierzina
d91400c3be Use pytest monkeypatch instead of unittest.mock.patch 2015-04-09 00:32:24 +02:00
Bruno Oliveira
d375ddebea Add new-line at the end of conftest.py 2015-04-08 19:16:45 -03:00
Bruno Oliveira
894a2a4e7b Add custom "gui" marker to tests which use qtbot fixture
Fixes #15
2015-04-08 19:14:06 -03:00
Raphael Pierzina
63ce7d6e02 Remove unittest methods in favor of pytest assert statements 2015-04-08 23:57:08 +02:00
Bruno Oliveira
e584aa319f Using parametrization in test_textbase
Also changed the wording a bit as suggested by @The-Compiler

Conflicts:
	tests/mainwindow/statusbar/test_textbase.py
2015-04-08 14:05:52 +02:00
Florian Bruhin
7d4e6dfd67 Another workaround for a pylint bug. 2015-04-08 06:39:12 +02:00
Florian Bruhin
679ffa452a Add some more invalid testcases to TestFont. 2015-04-08 06:22:05 +02:00
Florian Bruhin
fe696aeba5 Fix string concatenation and indenting for INVALID. 2015-04-08 06:20:43 +02:00
Bruno Oliveira
fd88311d9b Use inline list comprehension for parametrize expression 2015-04-08 01:07:56 -03:00
Bruno Oliveira
6e3c3d7a70 Use single-quoted string for consistency 2015-04-08 01:07:56 -03:00
Bruno Oliveira
a29b78e8ca Use mocker fixture instead of unittest.mock
As pointed out by @hackebrot
2015-04-08 01:07:55 -03:00
Bruno Oliveira
26dc275db3 Compare full lists instead of looping over items as suggested by @hackebrot 2015-04-08 01:06:31 -03:00
Bruno Oliveira
8702ac8a98 Fix small docstring issues 2015-04-08 01:06:30 -03:00
Bruno Oliveira
75386e4051 Remove "object" subclassing from Test classes missed initially 2015-04-08 01:06:30 -03:00
Florian Bruhin
9d44f777c0 Fix lint. 2015-04-05 20:30:31 +02:00
Bruno Oliveira
967c706bf0 Removed xfail from test since issue has been fixed on master 2015-04-05 12:29:18 -03:00
Bruno Oliveira
bfc99f09f9 Renamed test to tests as suggested by @The-Compiler 2015-04-05 12:23:04 -03:00