Commit Graph

64 Commits

Author SHA1 Message Date
Florian Bruhin
15c5cf75cd Reset standarddir args in TestConfigInit.
This caused test_transform_userstylesheet_base64 to fail.
2015-08-11 21:22:36 +02:00
Florian Bruhin
9c3c46f677 Add a workaround for pytest-html surrogate issue.
See https://github.com/davehunt/pytest-html/issues/12
2015-08-11 21:11:28 +02:00
Florian Bruhin
8351c6d951 Make TestFileAndUserStyleSheet use qapp fixture. 2015-08-11 20:16:19 +02:00
Florian Bruhin
88d92db6e4 Add tests for rel. inexistent File/UserStyleSheet. 2015-08-11 20:15:55 +02:00
Florian Bruhin
14545a3a22 Mark some tests as integration and no coverage. 2015-08-11 19:36:27 +02:00
Florian Bruhin
2fe1bcfc2b Skip GUI tests when no DISPLAY is available.
Fixes #851.
2015-08-09 22:45:24 +02:00
Florian Bruhin
fc09d63eb1 Fix lint. 2015-08-02 01:46:32 +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
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
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
e010d3dabc Fix os.path patching in tests.
Fixes #802.
2015-07-06 18:50:34 +02:00
Florian Bruhin
cef350ad66 tests: Use multiple pytest.mark.parametrize calls. 2015-07-06 17:56:13 +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
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
8001099661 Adjust tests. 2015-06-05 17:45:32 +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
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
98d1fca220 Use monkeypatch instead of mocker in some tests.
See #660.
2015-05-18 23:32:01 +02:00
Florian Bruhin
c762340a0c Add --datadir/--cachedir arguments. Closes #136. 2015-05-16 22:12:27 +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