Commit Graph

1159 Commits

Author SHA1 Message Date
Florian Bruhin
0b16a36120 Clean up handling of focus element
Also fixes #1359.
2016-08-08 14:05:30 +02:00
Ryan Roden-Corrent
7038db6b17 Combine completion-item-{prev,next}.
- Use a single command completion-item-focus with a next/prev argument.
- Add a rule to translate old configs.
- Regenerate the docs.

See #1095.
2016-08-08 07:37:53 -04:00
Florian Bruhin
dfbadaf7c2 Split WebElementWrapper into abstract/webkit parts 2016-08-08 13:04:53 +02:00
Florian Bruhin
627f743c26 Handle float in _convert_js_arg
This fixes 'gg' with QtWebEngine.
2016-08-08 08:04:55 +02:00
Jan Verbeek
ebfe23c376 Merge https://github.com/The-Compiler/qutebrowser into clip
Also make it possible to use multiple variables in one argument.
2016-08-07 13:14:46 +02:00
Florian Bruhin
26e0383d45 Merge branch 'refactor_command_completion' of https://github.com/rcorre/qutebrowser into rcorre-refactor_command_completion 2016-08-07 11:29:50 +02:00
Florian Bruhin
eb2f682e20 Merge branch 'fix-windows-editor' of https://github.com/Kingdread/qutebrowser into Kingdread-fix-windows-editor 2016-08-07 11:17:21 +02:00
Florian Bruhin
efada0a44c Merge branch 'yank-refactor' of https://github.com/mlochbaum/qutebrowser into mlochbaum-yank-refactor 2016-08-07 11:02:24 +02:00
Florian Bruhin
0b93272786 Merge branch 'sortfilter_tests' of https://github.com/rcorre/qutebrowser into rcorre-sortfilter_tests 2016-08-07 10:46:28 +02:00
Marshall Lochbaum
7bfa46fb50 Add tests for yank migrations 2016-08-06 20:36:13 -04:00
Jan Verbeek
38508274e0 Improve clipboard exceptions, migrate bindings 2016-08-07 00:46:23 +02:00
Daniel Schadt
4d00b8fce9 tests: fix tests for misc.editor
Due to the change to NamedTemporaryFile, the _filename attribute was
removed. We now have to use _file.name.
2016-08-07 00:18:22 +02:00
Ryan Roden-Corrent
66358e5b0f Remove usertypes.Completion.empty.
Completion.empty existed to fill a slot in the old Command.completions
interface if the first positional arg had no completions but the second
did, as is the case for the `bind` command. Now that
`Command.completions` is replaced by `Command.get_pos_arg_info`, this
is no longer needed.
2016-08-06 12:01:09 -04:00
Ryan Roden-Corrent
c792ffda67 Remove Command.completion.
Command completion types are now identified by ArgInfo, so just use
that directly and cut out the middle-man. This shouldn't change any
completion behavior.

Adds a test for get_pos_arg_info to test_cmdutils.

Modifies test_completer to test the use of get_pos_arg_info. Instead of
using FakeCommand, real Command objects are used, to validate that the
Completer works with the real Command interface. This also cleans out
some test cases that were testing things already covered by other cases.
2016-08-06 11:59:04 -04:00
Florian Bruhin
68595e1736 Make sure base URL for resolve_url is absolute 2016-08-05 17:12:09 +02:00
Florian Bruhin
7a65559cce Move hints._resolve_url to a WebElement method 2016-08-05 17:09:52 +02:00
Florian Bruhin
4541f19195 Fix crash when doing :<space><enter>
Introduced in #1577.
Fixes #1773.
2016-08-05 15:42:03 +02:00
Ryan Roden-Corrent
3e1409b1f5 Dedupe code in test_sortfilter.
Add helper functions to create and parse completion models, as this was
repeated in many tests.
2016-08-05 08:47:52 -04:00
Ryan Roden-Corrent
ed69ef86ab Unit test CompletionFilterModel.sort. 2016-08-05 08:29:29 -04:00
Ryan Roden-Corrent
83b621b0e6 Test CompletionFilterModel.set_pattern.
This is a more rigorous test than filterAcceptsRow as it tests behavior
with multiple columns and different sort settings. In addition, it
tests intelligentLessThan which is not tested in the filterAcceptsRow
test (as lessThan is never called if there is only 1 item to filter).
2016-08-05 07:20:31 -04:00
Ryan Roden-Corrent
8e7002db7a Test CompletionFilterModel.count 2016-08-05 07:20:31 -04:00
Ryan Roden-Corrent
f19b818b58 Test CompletionFilterModel.set_source_model 2016-08-05 07:20:31 -04:00
Ryan Roden-Corrent
b13153aa77 Test CompletionFilterModel.first/last. 2016-08-05 07:20:31 -04:00
Florian Bruhin
0169f3a24f Add _qutebrowser_ prefix for custom JS functions
With QtWebKit or QtWebEngine with Qt < 5.7, the functions end up in the
page's namespace. We can't easily avoid this, but at least we can name
them in a way which reduces conflicts.
2016-08-05 10:31:07 +02:00
Florian Bruhin
2b496a81ef tests: Use parametrize for parse_fatal_stacktrace 2016-08-05 09:01:09 +02:00
Florian Bruhin
029ea2e5a7 Add miscwidgets.WrapperLayout.wrap
This makes it easier for an user of WrapperLayout to wrap a widget.
2016-08-04 19:22:44 +02:00
Florian Bruhin
74b9b0ba90 Remove unneeded lambda 2016-08-04 18:15:29 +02:00
Florian Bruhin
a8ef956726 Add quotes for strings in javascript.assemble 2016-08-04 17:58:40 +02:00
Florian Bruhin
08b70f0f4c Add qutebrowser.utils.javascript
webelem.javascript_escape got renamed to javascript.string_escape, and a
new javascript.assemble got added to make it easier to call a function
inside a .js file.
2016-08-04 17:53:13 +02:00
Daniel Schadt
1400a27508 more tests for OpenFileDownloadTarget 2016-08-03 18:14:45 +02:00
Daniel Schadt
716ce701f5 utils: move elide_filename to own function
Also increase the elide limit in TempDownloadManager to 50, since that's
probably still enough for all systems.
2016-08-03 17:59:32 +02:00
Florian Bruhin
9851a13981 Add utils.random_port() 2016-08-03 13:08:55 +02:00
Florian Bruhin
dbccb12b49 Move WrapperLayout to miscwidgets 2016-08-03 13:08:25 +02:00
Florian Bruhin
fa7f9955a3 Add test for BackendError 2016-08-03 12:18:15 +02:00
Marshall Lochbaum
c19e1947f8 Remove tests for cmdutils.arg_or_count (fixes #1735 with previous commits) 2016-08-02 12:02:40 -04:00
Florian Bruhin
4a5b5c496f Fix using a relative path with --basedir 2016-08-02 14:08:28 +02:00
Florian Bruhin
483072d842 Don't use QSignalSpy in IPC test
Fixes #1727.

For another testcase in the same file we still need to use it until
pytest-qt has a MultiSignalBlocker.args.
2016-08-02 12:45:30 +02:00
Ryan Roden-Corrent
a393adc6c7 Don't crash completion with auto-open/show False.
If both are false, the selectionModel may be None.
In this case, don't try to move the index.
Resolves #1722.
2016-08-01 22:36:04 -04:00
Ryan Roden-Corrent
6e2d78b826 Don't crash on tab with no completions.
first_item and last_item return an invalid index when there are no
items in the completion, and the completionwidget will throw on an
invalid index. However, setting an invalid index on the selection view
is fine, so just remove the assertion.

Resolves #1731.
2016-08-01 22:16:55 -04:00
Florian Bruhin
ef439bb916 Fix ;o/;O default bindings 2016-08-01 18:19:34 +02:00
Florian Bruhin
693210920c Fix completion widget unit tests 2016-08-01 16:29:47 +02:00
Florian Bruhin
15863065cb Fix <input /> test in test_webelem 2016-08-01 16:28:54 +02:00
Florian Bruhin
68b273de87 Merge branch 'generalize-list-type' of https://github.com/mlochbaum/qutebrowser into mlochbaum-generalize-list-type 2016-08-01 16:22:13 +02:00
Florian Bruhin
62f9161d03 Merge branch 'completer_tests' of https://github.com/rcorre/qutebrowser into rcorre-completer_tests 2016-08-01 16:02:53 +02:00
Ryan Roden-Corrent
86a08d17c2 Dedupe code in test_readline.
Many of the tests repeated the same block of logic, so consolidate it
into one function.
2016-07-30 22:00:12 -04:00
Ryan Roden-Corrent
a086095954 Implement unix_filename_rubout.
unix_filename_rubout deletes to the previous slash or whitespace,
unlike the previously implemented backwards-kill-word which treats and
non-alphanumeric character as a boundary.

To illustrate, given the text 'foo/bar.baz', unix_filename_rubout will
delete 'bar.baz' while backwards-kill-word will delete only 'baz'.

See #1710.
2016-07-30 19:34:38 -04:00
Ryan Roden-Corrent
6bcdacf1ce Implement readline's backward-kill-word.
This restores the previous behavior of `unix-word-rubout` as
`backward-kill-word`, which is closer to the naming used in readline.
It is bound to <Alt-Backspace> by default, though <Ctrl-Backspace> will
also work due to a builtin binding.

Resolves #1698.
2016-07-30 07:27:29 -04:00
Ryan Roden-Corrent
fbadc5e668 Remove second arg from on_selection_changed.
The deselected argument was unused, so remove it from the signal and
the slot.
2016-07-29 08:48:24 -04:00
Florian Bruhin
c40059715a Fix long line 2016-07-29 10:43:53 +02:00
Florian Bruhin
cffe2281b1 Use qtmodeltester for completion model tests
See http://pytest-qt.readthedocs.io/en/latest/modeltester.html
See #1702
2016-07-29 10:26:55 +02:00
Florian Bruhin
4bf94f3c24 Use order='strict' with qtbot.waitSignals
See #1702
2016-07-29 09:12:06 +02:00
Florian Bruhin
a7e9b4e5d7 Get rid of extend=True for qt_log_ignore
This is now the default, see #1702
2016-07-29 09:12:06 +02:00
Ryan Roden-Corrent
dd827332c0 Clean up unused imports from completion refactor. 2016-07-28 12:20:24 -04:00
Ryan Roden-Corrent
f31e890862 Move completion_item_{next,prev} to CompletionView.
These commands are more closely tied to the CompletionView than
Completer. This removes the need for an extra signal tying the
CompletionView to the Completer.

The call to _open_completion_if_needed was moved to
on_selection_changed, as this will already be called when a new item is
selected.
2016-07-28 12:20:24 -04:00
Ryan Roden-Corrent
ffc5a42d04 Don't use objreg to get CompletionView.
The CompletionView is the parent of the Completer, so there's no need
to use objreg to get it.
See #640.
2016-07-28 12:20:24 -04:00
Ryan Roden-Corrent
b9cf9d180b Decouple Completer and CompletionView.
Rather than having a CompletionView instantiate and register a
Completer, instantiate both in MainWindow. The CompletionView is the
parent of the Completer, and communicates by emitting
selection_changed, meaning it no longer needs to contain a reference to
the Completer.
2016-07-28 12:20:24 -04:00
Ryan Roden-Corrent
d836fcb118 Code review for completion tests.
- clean up docstring typos
- use _ to name an unused loop variable
- parent the filter model to avoid an issue with disposal
- use mocker.patch instead of monkeypatch to mock Completer creation
- use is instead of == to compare by identity
2016-07-28 12:20:24 -04:00
Ryan Roden-Corrent
415ad7a638 Unit test completion view. 2016-07-28 12:20:24 -04:00
Ryan Roden-Corrent
a740f99607 Register the fake statusbar command in objreg.
The CompletionView looks in objreg for 'status-cmd', so move it from a
private fixture in test_completer to a public fixture that handles
objreg registration/deletion.
2016-07-28 12:20:24 -04:00
Ryan Roden-Corrent
e5da179ebf Limit the public interface of Completer.
Only schedule_completion_update and selection_changed are used
externally, so mark the rest of the API as private.
2016-07-28 12:20:24 -04:00
Ryan Roden-Corrent
aedf5b930a Test Completer.schedule_completion_update.
update_completion is only used internally, so instead test the real
public entry point which is schedule_completion_update.

This required mocking out QTimer to fire immediately so the test didn't
have to do flaky artificial delays.
2016-07-28 12:20:24 -04:00
Florian Bruhin
80d4af0da2 Add test webelem.__eq__ with other type 2016-07-28 17:29:45 +02:00
Florian Bruhin
a0ae96d43e Add more WebElementWrapper tests 2016-07-28 14:46:32 +02:00
Florian Bruhin
d357ccf403 Add some more WebElementWrapper tests 2016-07-28 14:25:53 +02:00
Florian Bruhin
c674bda43c Add new tests for test_webelem.test_vanished
This also adds test IDs for easier debugging.
2016-07-28 13:12:47 +02:00
Florian Bruhin
8d7baea9ae Fix test_passed_geometry 2016-07-28 12:36:09 +02:00
Florian Bruhin
ebc72c9b5f Fix TestRemoveBlankTarget.test_no_link 2016-07-28 12:36:09 +02:00
Florian Bruhin
540c62c232 Add only_visible to find_all_elements 2016-07-28 12:36:09 +02:00
Florian Bruhin
79b3f26de8 Decode HTML in test_filescheme
Otherwise we get a BytesWarning inside BeautifulSoup
2016-07-28 07:19:09 +02:00
Marshall Lochbaum
d51b1733e4 Add List to test_configtypes_hypothesis 2016-07-27 13:14:51 -04:00
Marshall Lochbaum
b205ad500b Add tests for configtypes.Url 2016-07-27 12:44:10 -04:00
Marshall Lochbaum
b4fec256dc Merge LengthList into List 2016-07-27 12:39:03 -04:00
Florian Bruhin
04aa98d7fb Release v0.8.1 2016-07-27 12:41:40 +02:00
Florian Bruhin
9ff006746f Handle empty command in CommandRunner.parse_all
Sicne we now call self._get_alias there, we also need to make sure it's
not an empty string before that.

Introduced in #1577. Fixes #1690.
2016-07-27 11:19:01 +02:00
Florian Bruhin
ccbd47a0cd Merge branch 'savefile_open-flush' of https://github.com/flv0/qutebrowser into flv0-savefile_open-flush 2016-07-27 10:11:33 +02:00
Marshall Lochbaum
a3c7ed51d4 Create LengthList to remove WebKitBytesList and refactor Padding 2016-07-26 23:59:55 -04:00
Marshall Lochbaum
083baf1222 Remove unnecessary List subclasses 2016-07-26 23:05:42 -04:00
Marshall Lochbaum
9e86933913 Replace List with BaseList and rename GenList to List 2016-07-26 23:02:10 -04:00
Marshall Lochbaum
d77145a5b8 Add GenList type and refactor *List types to use GenList 2016-07-26 21:34:50 -04:00
Florian Bruhin
b12c984846 Release v0.8.0 2016-07-26 13:30:41 +02:00
Florian Bruhin
3801960c61 tests: Add v0.8.0 to old_configs 2016-07-26 13:30:41 +02:00
Florian Bruhin
3ccb691e9f tab API: Rename scroll to scroller
The scroll attribute did overwrite QWidget.scroll which is unfortunate.
2016-07-26 13:19:07 +02:00
Florian Bruhin
f4f6a3dac1 Merge branch 'open-download' of https://github.com/Kingdread/qutebrowser into Kingdread-open-download 2016-07-26 10:32:34 +02:00
Florian Bruhin
64f208486e Add log.ignore_py_warnings() 2016-07-23 13:04:45 +02:00
Florian Bruhin
76eab7617b Remove @pyqtSlot for functions and non-QObjects
Fixes #1669
2016-07-23 11:42:50 +02:00
Ryan Roden-Corrent
48dbf505ce Limit config_tmpdir use in test_configtypes.
Only use the fixture in the test class that tries to access the config
dir (TestFileAndUserStyleSheet) rather than the whole test.
2016-07-18 21:49:37 -04:00
Ryan Roden-Corrent
7d36847f77 Prevent test_tab from creating user data dir.
This is another case (like test_qt_javascript) that needs redirection
of XDG_DATA_HOME to prevent Qt from creating ~/.share/local/qute_test.
2016-07-17 07:07:05 -04:00
Ryan Roden-Corrent
5ae9d985b1 Prevent lingering object from test_config.
Using the config_tmdpir fixture across all tests in this module caused
a lingering LineParser to make test_debug fail.
I still don't know why, but scoping the config_tmpdir fixture to only
the test class that was creating ~/.config/qute_test fixes the issue,
and still prevents creation of a user tempdir.
2016-07-16 06:47:12 -04:00
Ryan Roden-Corrent
f589e44700 Don't write to user datadir in test_qt_javascript.
This was more complicated than the other data/config/cachedir test
fixes, as QtWebEngine was accessing the datadir directly (and bypassing
standdarddir.data).

This means the tmpdir_data stub is not enough, we need to set
XDG_DATA_HOME to redirect access.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
d9b546701e Prevent creation of user dirs on several tests.
Use the config_tempdir and data_tempdir fixtures for several tests that
were creation ~/.config/qute_test or ~/.local/share/qute_test.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
a6695ea1be Prevent test_adblock from creating real config dir.
Don't create ~/.config/qute_test by mocking out standdarddir.config for
all tests in this module.

This adds config_tmpdir to fixtures.py and moves temp_datadir from
test_adblock to fixtures.py as it will be needed more broadly.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
9c9b367887 Completely prevent tests from creating cachedir.
Attempting to fix the test on windows caused it to create the cachedir
again. The call to init(None) was unnecessary.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
cee5d6b97f Use fake_args in test_standarddir. 2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
34583d1565 Fix standarddir test on Windows.
Was broken by 48a2cad while trying to prevent creation of qute_test in
non-temp locations.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
1f71520bb2 Prevent tests from creating cachedir tag.
Running test_standarddir would pollute the user's home with
`~/.cache/qute_test`.

The `no_cachedir_tag` fixture was supposed to prevent this, but was not
working because [usefixtures does not work on fixtures]
(https://github.com/pytest-dev/pytest/issues/1014).

This fixes the fixture to actually prevent cachedir creation, but
applies it to tests individually (or by class) rather than with autouse
because the cachedir tests cannot pass if it is working.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
daaa5ff5c5 Don't create real config/data dirs from tests.
Running the tests would create ~/.config/qute_test and
~/.local/share/qute_test on the user's machine. The test_standardir
module needed a bit more mocking to prevent it from cluttering the
user's machine.

Two tests that created the data dir were fixed by passing basedir in
args, and one test that created the config dir was fixed by patching
os.makedirs to a noop.
2016-07-15 13:46:50 -04:00
Florian Bruhin
7b9d38e438 Fix config values being lost with DELETED_OPTIONS
When an option was deleted, we accidentally stopped reading instead of
ignoring that one option and then resuming.
2016-07-14 16:58:54 +02:00
Florian Bruhin
325846f20a Remove doubled check 2016-07-14 16:33:59 +02:00
Florian Bruhin
b59a1766c8 Fix long line 2016-07-13 21:19:02 +02:00
Florian Bruhin
c9176b7c58 QtWebEngine: Fix 'unset' with run_js_blocking 2016-07-13 18:17:37 +02:00
Florian Bruhin
a7509d5978 Fix lint 2016-07-13 16:01:12 +02:00
Daniel Schadt
029ffe3fc7 tests: add tests for usertypes.DownloadTarget 2016-07-13 14:17:41 +02:00
Florian Bruhin
5b1cca92ab Add run_js_blocking to tab API 2016-07-13 13:47:30 +02:00
Florian Bruhin
4f97b6342d tests: Add a tab fixture in test_tab 2016-07-13 13:47:29 +02:00
Florian Bruhin
558ef290e4 tests: Add a view fixture in test_tab 2016-07-13 13:47:26 +02:00
Florian Bruhin
68f5ed4fa4 tests: Fix FakeWebTabScroller
Pass tab correctly
2016-07-13 13:47:26 +02:00
Jan Verbeek
bbc46d28ff Use lists instead of tuples for comparing
Per one of the diff comments on #1597:
> I used to use a tuple for constant things, but nowadays I'd actually
> prefer a list as a tuple is something more heterogeneous (i.e. it
> makes sense to have a `(x, y)` point as a tuple, but a list of points
> would be a list).
> At some point I should probably change it to a list everywhere 😉
2016-07-12 22:05:32 +02:00
Florian Bruhin
1c86669628 Fix test_config.py
We used wrap-search to test interpolations there, but that's gone now.
2016-07-12 17:31:32 +02:00
Daniel Schadt
05c09a1476 tests: fix test_adblock for new download manager 2016-07-12 17:06:40 +02:00
Florian Bruhin
cd4eff364a Add printing to tab API
This fixes printing for QtWebKit, and hopefully will make printing to
PDF work with QtWebEngine with Qt >= 5.7
2016-07-12 12:54:11 +02:00
Florian Bruhin
37c6d63ddf tests: Ignore "load glyph failed" warnings
See #1637
2016-07-12 09:45:40 +02:00
Florian Bruhin
e80475ed57 Remove support for showing JS statusbar messages
Closes #1579.
2016-07-11 16:19:44 +02:00
Florian Bruhin
f46d6cbe27 Fix url_text, take 3 2016-07-11 15:06:36 +02:00
Florian Bruhin
9b75e661e2 Fix missed url_text substitutions 2016-07-11 14:59:35 +02:00
Florian Bruhin
a470bfc3f3 Get rid of url_text_changed signal
Instead we simply use url_changed which (similar to Qt's urlChanged)
simply has a QUrl argument.
2016-07-11 14:28:51 +02:00
Florian Bruhin
64dc099d51 pylint: Enable docstyle extension 2016-07-11 13:47:18 +02:00
Florian Bruhin
6a07d231f4 pykint: Add some disable=unused-variable 2016-07-11 13:18:31 +02:00
Florian Bruhin
43c1f62e39 Also skip test_tab on PyQt < 5.6
See #1638
2016-07-11 09:10:11 +02:00
Florian Bruhin
b791095324 Rename browser.tab module and classes 2016-07-10 17:27:02 +02:00
Florian Bruhin
2649418c0b Fix lint 2016-07-10 17:04:26 +02:00
Florian Bruhin
d2ece6b542 Move Backend enum to usertypes
Otherwise we have a cyclic import
2016-07-10 17:04:26 +02:00
Florian Bruhin
34e39bed4e Add a test for cmd instance with wrong backend 2016-07-10 17:04:25 +02:00
Florian Bruhin
fd8e66136f tests: Add a mode_manager fixture 2016-07-10 17:04:25 +02:00
Florian Bruhin
7859df74c4 Add tests for Command.run 2016-07-10 17:04:25 +02:00
Florian Bruhin
2136d00aa2 tests: Add a fake_args fixture 2016-07-10 17:04:25 +02:00
Florian Bruhin
949172809d Add tab_registry to test_tab 2016-07-10 16:57:02 +02:00
Florian Bruhin
e36123735b Use a fixture for FakeWebTab
We need to make sure qapp and tab_registry are available everywhere the
FakeWebTab class is used.
2016-07-10 16:57:02 +02:00
Florian Bruhin
06a6daee34 Add stubs for QtWebEngine 2016-07-08 12:53:48 +02:00
Florian Bruhin
cc11af5e28 Fix lint 2016-07-08 11:21:00 +02:00
Florian Bruhin
334f6cda4f tab: Rename modeman to mode_manager
To avoid it being mixed up with the modeman module
2016-07-08 10:38:51 +02:00
Florian Bruhin
7c6dd60f35 Fix test_on_tab_changed in statusbar.url tests
- The invalid URL will now get encoded when using QUrl.
- The check for a None url_text is somewhat pointless as I don't think
  this can ever happen in the real circumstances.
2016-07-08 10:38:51 +02:00
Florian Bruhin
782561462b Use stubs.FakeWebTab to fake tabs
This also fixes the cur_url access.
2016-07-08 10:09:03 +02:00
Florian Bruhin
2befebaf3a Don't use properties for AbstractTab
Otherwise exceptions in there could be hidden by Python/PyQt.

Some places are not changed yet, as there are also other renames in the
next commits.
2016-07-08 10:05:46 +02:00
Florian Bruhin
e4b0b7fffd Fix lint 2016-07-07 20:12:17 +02:00
Florian Bruhin
fea25d715c Add Percentage test with None-value 2016-07-07 18:32:52 +02:00
Florian Bruhin
5420d6d2ae Mark some session tests as xfail
There'll be a refactoring to add a session API to WebTab later anyways,
so no point in fixing this now.

As many tests as possible here should probably also be changed to
end2end ones as there's a lot of mocking going on.
2016-07-07 18:32:52 +02:00
Florian Bruhin
17466b4f26 Fix some lint 2016-07-07 18:32:52 +02:00
Florian Bruhin
4e5a7a891e tests: Use FakeWebTab for stubbing 2016-07-07 18:32:52 +02:00
Florian Bruhin
5107a87291 Fix test_tab tests 2016-07-07 18:32:52 +02:00
Florian Bruhin
21b282ce29 Get rid of _DummyUserscriptRunner
This simplifies the code a bit and only provides
userscript.run_async (and not the UserscriptRunner class) as entrypoint.
2016-07-07 18:32:52 +02:00
Florian Bruhin
a6307497c0 Rewrite userscripts to work with async dumping 2016-07-07 18:32:52 +02:00
Florian Bruhin
78f425c98b Add AbstractTab.data 2016-07-07 18:32:52 +02:00
Florian Bruhin
4fea285740 Add win_id attribute 2016-07-07 18:32:52 +02:00
Florian Bruhin
0c1e266073 Use QWebView/QWebEngineView for test_tab 2016-07-07 18:32:52 +02:00
Florian Bruhin
5b9ae8bc85 Initial history implementation 2016-07-07 18:32:52 +02:00
Florian Bruhin
37c3dbbc7d Fix test_tab 2016-07-07 18:32:52 +02:00
Florian Bruhin
d2dd32b979 Fix test_url 2016-07-07 18:32:52 +02:00
Florian Bruhin
bf286f8c74 Fix some tests 2016-07-07 18:32:52 +02:00
Florian Bruhin
4305966f7b Add WrapperLayout/AbstractTab 2016-07-07 18:32:52 +02:00
Florian Bruhin
29ee605c79 Fix version output test on Windows
On Windows we get something like C:\IMPORTPATH instead of /IMPORTPATH
2016-07-07 18:32:13 +02:00
Florian Bruhin
674b316db3 Simplify test_version_output 2016-07-07 09:14:36 +02:00
Florian Bruhin
ebf9bc4e0a Improve version output 2016-07-06 23:47:59 +02:00
Florian Bruhin
b429b919b5 Merge branch 'completer_tests' of https://github.com/rcorre/qutebrowser into rcorre-completer_tests 2016-07-06 13:35:13 +02:00
Florian Bruhin
70117265d6 Fix some a/an misspellings
Thanks to https://github.com/jwilk/anorack
2016-07-05 08:34:03 +02:00
Ryan Roden-Corrent
6c2c9438a7 More completer unit test cases. 2016-07-04 19:06:00 -04:00
Ryan Roden-Corrent
4c9417ac6e Use helper method for cmd prompt text testing.
In test_completer, introduce two helper methods to reduce duplicate
code for handling fake cmd prompt text that uses '|' as a placeholder.
2016-07-04 12:31:56 -04:00
Ryan Roden-Corrent
27d635a394 Test selection_changed, not change_completed_part.
For the Completer unit tests:
Although `change_completed_part` looks like a public method, it was
only used internally. Test the externally-used method
`selection_changed` instead.
2016-07-04 08:22:21 -04:00
Ryan Roden-Corrent
a6a8bf9304 Clean up test_completer further.
Based on code review:
- Use qtbot.waitSignal to test a signal firing
- Use pytest.mark.xfail for an expected test failure
- Ensure there are 2 newlines between module-level functions
2016-07-04 07:36:31 -04:00
Ryan Roden-Corrent
68e373df44 Use QLineEdit as a base for FakeStatusbarCommand.
Reduces the amount of mocking and keeps it more true to the original.
2016-07-03 23:06:36 -04:00
Ryan Roden-Corrent
7f690c3f3f More unit test coverage for Completer.
Test completion_item{next,prev} and change_completed_part.
2016-07-03 22:58:09 -04:00
Ryan Roden-Corrent
9bfff1c685 Test more cases for completer.update_completion. 2016-07-03 17:18:16 -04:00
Ryan Roden-Corrent
13e8ed53d6 Clean up completer unit test.
Based on code review:

    - import modules, not classes
    - use methods, not lambdas for the mock command prompt class
    - use None rather than Mock for DUMB_SORT
    - autouse two fixtures and remove them from test signatures
2016-07-03 17:18:16 -04:00
Ryan Roden-Corrent
07edcce697 Unit test Completer.update_completion.
Validate update_completion sets the completions widget's model
correctly based on the command text.
2016-07-02 12:25:55 -04:00
Florian Bruhin
3a73351779 Merge branch 'patch-2' of https://github.com/edi9999/qutebrowser into edi9999-patch-2 2016-07-01 22:53:49 +02:00
Florian Bruhin
a3b0e7c1cb Fix indent 2016-07-01 14:38:18 +02:00
Ryan Roden-Corrent
d45acb0388 Eliminate FakeSettingSection/Value.
Don't really need to mock these out for tests as the real classes are
simple enough.
2016-06-30 20:12:44 -04:00
Ryan Roden-Corrent
94ec712ea8 Really clean up Qt view in completion tests.
Missed a spot.
2016-06-30 20:12:04 -04:00
Ryan Roden-Corrent
4178f73ed9 Move utility functions to top of test_completion.
Just a style change.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
849706e310 Clean up Qt view used in completion tests.
Add the view created during the tests to qtot so it gets cleaned up
after the test exits.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
ee59b133c0 Don't bother mocking a history entry.
Use webkit.history.Entry in tests instead of FakeHistoryEntry.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
d6012ad95c Test delete_cur_item more cleanly.
Reduce duplicate code by mocking out a QTreeView around the model and
setting its index.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
9d49f5a57d Test tab completion with multiple tabbed browsers. 2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
b6652ad6bc Test completion quickmark/bookmark deletion.
Validate that quickmarks and bookmarks can be deleted from the url
completion menu.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
409de10fb4 Unit test delete_cur_item for tab completion model. 2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
8321c1a90f Unit test setting value completion 2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
f5b1019d4d Unit test config option completion.
Had to add the `raw` parameter to ConfigStub.get as the setting option
completion model passes this argument explicitly (although the docs say
only raw=True is supported).
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
5255a71bc5 Unit test setting section completion. 2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
d49fa7c4a3 Clean up objreg after test_history.
test_init in test_history was leaving a web-history in the objreg,
which was interfering with the completion tests.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
16f043034f Unit test tab (buffer) completion.
This involved adding a few stubs as well as expanding the FakeWebView.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
610f9b7068 Unit test session completion 2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
baf8d00a20 Unit test url/quickmark/bookmark completion.
This also adds a few more stubs/fakes to mock out the
quickmark-manager, bookmark-manager, and web-history objects.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
b037ec489f Add unit tests for help completion.
Also adds a FakeConfigSection stub for stubbing out configdata.DATA.
2016-06-30 07:26:02 -04:00
Ryan Roden-Corrent
555bdb75b5 Add unit test for CommandCompletionModel.
This establishes a pattern that can probably be used to test any of the
completion models.

See #999.
2016-06-30 07:26:02 -04:00
Florian Bruhin
900ad1ba6d Merge branch 'alias-multi-commands' of https://github.com/mgoral/qutebrowser into mgoral-alias-multi-commands 2016-06-30 12:34:18 +02:00
Florian Bruhin
03fbacd93c requirements: Update vulture to 0.9
* Don't flag attributes as unused if they are used as global variables in
  another module.
* Don't consider "True" and "False" variable names.
* Abort with error message when invoked on .pyc files.

This means we can remove the whitelisted globals in run_vulture.py and
the associated xfailing test.

We also needed to adjust run_vulture.py slightly as the file attribute
got renamed to filename.
2016-06-29 23:44:39 +02:00
Patric Schmitz
217b912f3c revert custom exception throwing in savefile_open
instead adapt test_failing_flush to catch correct exception (ValueError).
2016-06-28 15:03:23 +02:00
Patric Schmitz
a33978ee89 fix error handling in savefile_open and tests 2016-06-28 12:59:00 +02:00
Edgar Hipp
81c69421c5 Update test_readline.py 2016-06-24 12:00:53 +02:00
Ryan Roden-Corrent
9578a3324e Break two long lines that were failing pylint. 2016-06-13 22:31:21 -04:00
Michał Góral
9b394e4111 Use config_stub instead of monkeypatching config.get() 2016-06-13 19:39:00 +02:00
Florian Bruhin
4fccc89d7d Split browser into browser/browser.webkit 2016-06-13 11:18:21 +02:00
Florian Bruhin
f70a75978b Move browser.network.pastebin to misc 2016-06-13 09:48:53 +02:00
Michał Góral
4b883c089e Fixed linters. 2016-06-12 23:04:14 +02:00
Michał Góral
370c8a8b07 Created tests for reading aliases. 2016-06-12 22:31:10 +02:00
Michał Góral
7ee99ba043 Moved searching for aliases to CommandRunner.parse_all()
This addresses issue with having alias for multiple commands splitted by ';;'.

See: The-Compiler/qutebrowser#956.
2016-06-12 21:09:10 +02:00
Florian Bruhin
acf54c5cbe Release v0.7.0 2016-06-10 15:18:56 +02:00
Florian Bruhin
a95b8eed9b tests: Add config for v0.7.0 2016-06-10 15:14:22 +02:00
Florian Bruhin
66938ed44b Full redirect support for history
When a redirect occurs, the item is saved in history with a -r suffix
now. When opening qutebrowser that's picked up and the item is hidden
from completion.
2016-06-10 14:40:42 +02:00
Florian Bruhin
0a25bb508a Fix lint 2016-06-10 12:21:48 +02:00
Florian Bruhin
9298fa697b Allow to pass atime to WebHistory.add_url
This makes a lot of tests easier and/or more exact.
2016-06-10 12:12:29 +02:00
Florian Bruhin
7511bc1fe5 tests: 100% coverage for browser.history 2016-06-10 12:01:14 +02:00
Florian Bruhin
14a04f1535 Fix lint 2016-06-09 22:03:35 +02:00
Florian Bruhin
185b4bc18b Add more tests for browser.history 2016-06-09 21:14:04 +02:00
Florian Bruhin
d3dd6d2f77 Add hypothesis test for history.Entry.from_str 2016-06-09 21:14:04 +02:00
Florian Bruhin
33f01d8375 Fix lint 2016-06-09 21:14:03 +02:00
Florian Bruhin
9510af9912 Use QUrl with QWebHistory
Now that we have our own history implementation, we get the URLs as QUrl
and not as string - so no point in converting them to string and back.
2016-06-09 21:14:03 +02:00
Florian Bruhin
5f25ce69ec Add some tests for browser.history 2016-06-09 21:14:03 +02:00
Florian Bruhin
789b9c9308 tests: Yield fake_save_manager from fixture 2016-06-09 17:44:04 +02:00
Florian Bruhin
75669dd21b tests: Move fake_save_manager to helper.fixtures 2016-06-09 17:44:04 +02:00
Florian Bruhin
86632804a9 behaviour -> behavior for consistency 2016-06-09 17:30:14 +02:00
Florian Bruhin
ab8a2f7147 Fix lint 2016-06-09 17:12:23 +02:00
Florian Bruhin
2d54c927e3 Fix urlutils tests on Qt 5.6.1
For some reason the behaviour of QHostAddress("31c3").isValid() changed
with Qt 5.6.1: https://bugreports.qt.io/browse/QTBUG-53983

This causes the test to fail because Qt thinks this is a valid IP, so we
think it's a valid URL.
2016-06-09 15:16:49 +02:00
Florian Bruhin
aae205030c Add missing import 2016-06-09 10:29:16 +02:00
Florian Bruhin
d6926f0622 Fix expected data in AppendLineParser test
There were two different issues here:

- `\n` rather than `os.linesep` was used, which caused the "generated"
  file to have less data in it than expected
- A final `os.linesep` (or `\n`) was missing, but that was cancelled out
  by a off-by-one error when slicing, so wasn't an issue until we tried
  with \r\n endings.
2016-06-09 10:26:09 +02:00
Florian Bruhin
a870a2888f Improve LineParser clear tests 2016-06-08 11:33:37 +02:00
Florian Bruhin
44f626134b Use real files for lineparser tests 2016-06-08 11:33:37 +02:00
Florian Bruhin
1d51d63f0c LineParser tests: Clear self._data in _open 2016-06-08 10:36:46 +02:00
Florian Bruhin
b09fe8dca0 Document LineParserMixin attributes 2016-06-08 10:22:55 +02:00
Florian Bruhin
33bcced4a2 Add a test for AppendLineParser.clear 2016-06-08 10:11:59 +02:00
Florian Bruhin
cca26f0f13 Fix lint 2016-06-08 09:45:05 +02:00
Florian Bruhin
e8123bb68a Fix pdfjs version parsing for never versions 2016-06-07 07:42:34 +02:00
Florian Bruhin
520572321a Add unittests for partial command parsing 2016-06-06 16:18:49 +02:00
Florian Bruhin
4e86a888c9 Add webelem tests for JS/non-JS rect_on_view 2016-06-06 15:42:30 +02:00
Florian Bruhin
abfd789f9e Fix zooming with a too big count
Fixes #1118
Supersedes #1140
2016-06-06 13:25:01 +02:00
Florian Bruhin
8d5fdf2833 Remove wrap mode for NeighborList 2016-06-06 13:10:14 +02:00
Florian Bruhin
10630e30ab hints: Integrate _get_first_rectangle into webelem 2016-06-06 11:56:15 +02:00
Daniel Schadt
d4a295b22e tests: update test_log with json_logging namespace 2016-05-30 16:00:10 +02:00
Florian Bruhin
86be7ad82c Move file_url from utils.jinja to utils.urlutils 2016-05-29 22:44:40 +02:00
Florian Bruhin
64d4c9f83e Clean up end2end test file structure
This renames tests/integration to tests/end2end and moves some files to
tests/end2end/fixtures.
2016-05-29 18:20:00 +02:00
Florian Bruhin
b97736b117 Revert "Work around flake8-string-format bug"
This reverts commit 6c4beef783.
2016-05-29 14:17:32 +02:00
Florian Bruhin
6caa89a622 Merge branch 'empty_uri' of https://github.com/hcraT/qutebrowser into hcraT-empty_uri 2016-05-29 00:37:12 +02:00
Tarcisio Fedrizzi
ec2935fab0 Fixes flake8 error 2016-05-28 17:38:31 +02:00
Florian Bruhin
1d87eee4d7 Fix starting when sys.stderr is None 2016-05-27 14:48:46 +02:00
Florian Bruhin
afcb018ee2 Fix some spelling mistakes
Found via http://jwilk.net/software/mwic
2016-05-27 12:07:00 +02:00
Florian Bruhin
6c4beef783 Work around flake8-string-format bug
When using flake8-string-format on Python 3.5 with str.format(*group) it
failed:

  Traceback (most recent call last):
    File "./.venv-flakes/bin/flake8", line 11, in <module>
      sys.exit(main())
    File ".../site-packages/flake8/main.py", line 33, in main
      report = flake8_style.check_files()
    File ".../site-packages/flake8/engine.py", line 181, in check_files
      return self._retry_serial(self._styleguide.check_files, paths=paths)
    File ".../site-packages/flake8/engine.py", line 172, in _retry_serial
      return func(*args, **kwargs)
    File ".../site-packages/pep8.py", line 1842, in check_files
      runner(path)
    File ".../site-packages/flake8/engine.py", line 126, in input_file
      return fchecker.check_all(expected=expected, line_offset=line_offset)
    File ".../site-packages/pep8.py", line 1574, in check_all
      self.check_ast()
    File ".../site-packages/pep8.py", line 1521, in check_ast
      for lineno, offset, text, check in checker.run():
    File ".../site-packages/flake8_string_format.py", line 288, in run
      assert isinstance(call.args, ast.Starred) is bool(has_starargs)
  AssertionError

This works around that issue.
See https://github.com/xZise/flake8-string-format/issues/11
2016-05-26 23:50:58 +02:00
Tarcisio Fedrizzi
a3e6761db6 Fixes pylint error 2016-05-26 18:01:01 +02:00
Tarcisio Fedrizzi
a9e96df5df Adds unit test when force_search is True 2016-05-26 18:01:01 +02:00
Tarcisio Fedrizzi
462f9d7e4c Refators discussed in the review
- refactors what discussed in the review
- adds unit tests for schemas without host and path
2016-05-26 18:01:01 +02:00
Florian Bruhin
c96722f169 Merge branch 'better_keyhints' of https://github.com/rcorre/qutebrowser into rcorre-better_keyhints 2016-05-25 22:04:51 +02:00
Ryan Roden-Corrent
f58e2d91dc Add a keyhint blacklist.
Replace the setting ui.show-keyhints with ui.keyhint-blacklist, which
is a list of globs for keychains that shouldn't be hinted. This allows
users to prevent showing keyhints for keychains they already know.

keyhint-blacklist='*' is equivalent to show-keyhints=False.

Resolves #1515.
2016-05-24 20:46:39 -04:00
Florian Bruhin
3bbc950616 Fix lint 2016-05-24 21:53:50 +02:00
Florian Bruhin
846fe8b943 Add a test for #1484 2016-05-24 21:36:09 +02:00
Ryan Roden-Corrent
b1aaf0f10f Only show keyhints after a short delay.
If a user knows the keychain and can type it quickly, we shouldn't
annoy them with a popup. Only show the keyhint if the user doesn't
complete their keychain in 500ms.

The isVisible() check in the tests is somewhat invalid now because it
is never immediately visible and I don't want to add a delay to unit
tests. I added a check that text() is not set for one test that was
only checking isVisible().

Addresses part of #1515.
2016-05-23 21:21:03 -04:00
Florian Bruhin
b934f8bc4e Fix lint 2016-05-20 13:07:36 +02:00
Ryan Roden-Corrent
b1440a1804 Implement utils.is_special_key.
The check `key.startswith('<') and key.endswith('>') is repeated many
times in code to check for a special key. Replace all these with a call
to the same function.
2016-05-19 20:48:48 -04:00
Ryan Roden-Corrent
5992b81850 Don't show keyhint if there are no hints.
Currently, the keyhint window is shown even if the keystring matches no
possible bindings. This causes an empty keyhint window to hang around
after entering hinting mode.

Instead, the window is now hidden if no bindings match the current
keystring.

Resolves #1507.
2016-05-19 07:02:23 -04:00
Stefan Tatschner
2c7dc6ffcc Add invalid url to 'test_set_hover_url_encoded'
This covers the recently introduced code path, in 1c23815 (Fix crash
when hovering over an invalid URL, 2016-05-18) when hovering an
invalid URL.
2016-05-18 22:23:26 +02:00
Florian Bruhin
d0af80fbd5 Merge branch 'keystring' of https://github.com/rcorre/qutebrowser into rcorre-keystring 2016-05-18 07:33:17 +02:00
Florian Bruhin
324fcfadb0 Merge branch 'hint_inputs' of https://github.com/Liambeguin/qutebrowser into Liambeguin-hint_inputs 2016-05-18 07:30:46 +02:00
Florian Bruhin
02cbc2f986 Merge branch 'pretty-hover-url' of https://github.com/forkbong/qutebrowser into forkbong-pretty-hover-url 2016-05-18 07:27:30 +02:00
Florian Bruhin
e4d84b0bfc Simplify argparser.type_check
If the value isn't param.default, it will always be a string or a flag, as
type_conv never gets called when the function is called from Python.
2016-05-18 07:16:17 +02:00
Florian Bruhin
a83bf9c3ee Simplify argparser.type_conv
Since we're not using those functions as argparse callbacks anymore, we
can write a normal function instead of factories, which simplifies
things a lot.
2016-05-18 06:55:27 +02:00
Florian Bruhin
c0d044447d Add tests for qutebrowser.utils.typing 2016-05-18 06:55:17 +02:00
Florian Bruhin
6ed9b6b13f Make sure typing.Union[str, int] gets handled
str always needs to be the last element checked as otherwise it'd always
win.
2016-05-18 06:55:17 +02:00
Florian Bruhin
a0d0b6464f Use typing.py-like annotations for command args
This means:

- An annotation like (int, str) is now typing.Union[int, str].
- utils.typing got expanded so it acts like the real typing.py, with
  issubclass() working properly with typing.Union and __union_params__
  being set.
- A literal string doesn't exist anymore as annotation, instead
  @cmdutils.argument now has a 'choices' argument which can be used like
  @cmdutils.argument('arg', choices=['val1', 'val2']).
- Argument validating/converting is now entirely handled by
  argparser.type_conv instead of relying on python's argparse, i.e.
  type/choices is now not passed to argparse anymore.
2016-05-18 06:55:17 +02:00
Florian Bruhin
3a33bc42a6 Add initial support for the typing module 2016-05-18 06:55:17 +02:00
Florian Bruhin
9694374673 Add test for cmd arg types 2016-05-18 06:55:17 +02:00
Florian Bruhin
c33f0c3512 Use @cmdutils.argument for completions 2016-05-18 06:55:17 +02:00
Florian Bruhin
3ab40bbc23 Clear globals correctly for all cmdutils tests
TestArgument didn't clear the globals as the fixture was inside
TestRegister.

This means test_run_vulture failed in funny ways because run_vulture.py
generated a whitelist containing "<locals>" for commands:

    tests/unit/scripts/test_run_vulture.py:55: in run
        return run_vulture.run([str(e.basename) for e in files])
    scripts/dev/run_vulture.py:146: in run
        vult.scavenge(files + [whitelist_file.name])
    .tox/py35/lib/python3.5/site-packages/vulture.py:107: in scavenge
        self.scan(module_string)
    .tox/py35/lib/python3.5/site-packages/vulture.py:75: in scan
        node = ast.parse(node_string, filename=self.file)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    source = 'qutebrowser.browser.commands.CommandDispatcher.buffer\nqutebrowser.misc.savemanager.SaveManager.save_command\nqutebro...iidoc.UsageFormatter._get_default_metavar_for_positional\nscripts.dev.src2asciidoc.UsageFormatter._metavar_formatter\n'
    filename = '/tmp/tmp_ein2umn', mode = 'exec'

        def parse(source, filename='<unknown>', mode='exec'):
            """
            Parse the source into an AST node.
            Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
            """
    >       return compile(source, filename, mode, PyCF_ONLY_AST)
    E         File "/tmp/tmp_ein2umn", line 16
    E           test_cmdutils.TestArgument.test_wrong_order.<locals>.fun
    E                                                       ^
    E       SyntaxError: invalid syntax
2016-05-18 06:55:17 +02:00
Florian Bruhin
c14db202d6 Use @cmdutils.argument to hide arguments 2016-05-18 06:55:17 +02:00
Florian Bruhin
2370793f38 Make win_id/count mutually exclusive for ArgInfo 2016-05-18 06:55:17 +02:00
Florian Bruhin
35135c4b0d Use @cmdutils.argument for win_id/count 2016-05-18 06:55:17 +02:00
Florian Bruhin
04367851c3 Refactor how cmdutils.ArgInfo works
It's now a real class, and some other aspects about how it's handled
were cleaned up as well.
2016-05-18 06:55:17 +02:00
Florian Bruhin
9eeaeb95c3 Make sure @cmdutils.argument after @register fails 2016-05-18 06:55:17 +02:00
Florian Bruhin
3c586f34ff Add a @cmdutils.argument decorator
For now the only available keyword argument is 'flag' which customizes
the flag an argument will get.

See #637.
2016-05-18 06:55:17 +02:00
Liam BEGUIN
f689cca101 Added missing All group 2016-05-17 23:57:36 -04:00
Liam BEGUIN
ce0d23bd10 Added tests for the inputs group 2016-05-17 19:58:48 -04:00
Ryan Roden-Corrent
822d148713 Update key hint tests for new format.
Change the unit tests to expect the new tabular format.
Also generally clean up the tests -- refactor from a class to
module-level functions as there was no need for a class here.
2016-05-17 07:04:53 -04:00
Ryan Roden-Corrent
3cd252ef82 Clean up html for keyhint text.
The \t was behaving the same as a space and the <b> was doing nothing.
2016-05-15 22:33:53 -04:00
Ryan Roden-Corrent
8eee5def5d Add unit tests for the keyhint widget.
- validate keyhint text for a partial keychain
- ensure special keybindings are not suggested
- ensure it is not visible when disabled
- ensure changes to the suffix color are picked up
2016-05-15 22:20:52 -04:00
Panagiotis Ktistakis
224c877fec Hide passwords in hovering URLs 2016-05-15 19:07:10 +03:00
Panagiotis Ktistakis
c88883fcb3 Decode URL in statusbar when hovering over it 2016-05-14 19:52:24 +03:00
Florian Bruhin
c64e5c9bd5 Get rid of the colorlog dependency
colorlog was problematic for various reasons:

- Not commonly packaged for Linux distributions
- Calling colorama.init() automatically on import
- Not supporting {foo} log formatting
- Not supporting an easy way to turn colors off

Instead we now do the log coloring by hand, which is simpler and means
everyone will have colored logs.
2016-05-13 21:19:33 +02:00
Florian Bruhin
36da07c73b Fix lint 2016-05-10 07:56:54 +02:00
Florian Bruhin
5eff35ba30 cmdutils.register: annotation -> arg for flags
Instead of using a 'flag' key in the annotation dict, we now use a flags
argument to @cmdutils.register which is a {argument: flag} dict.

See #637.
2016-05-10 07:35:41 +02:00
Florian Bruhin
49fb981e7f Add test for completion count in cmdutils.register 2016-05-10 07:12:50 +02:00
Florian Bruhin
9ca5acd546 Add tests for flags with @cmdutils.register 2016-05-10 07:00:10 +02:00
Florian Bruhin
b17ecd1376 Add tests for cmdutils.register/star_args_optional 2016-05-10 06:41:42 +02:00
Florian Bruhin
a23aa1cc47 Fix broken supports_selection() test 2016-05-08 22:39:39 +02:00
Florian Bruhin
b9b6f357da Add utils.supports_selection() 2016-05-08 22:06:59 +02:00
Florian Bruhin
ddc1f803c0 Clean up assertion 2016-05-08 20:01:35 +02:00
Florian Bruhin
f49cc4e901 Only keep contain tests 2016-05-08 19:57:59 +02:00
Florian Bruhin
65ed878dcf Update copyright 2016-05-08 19:57:18 +02:00
Florian Bruhin
fdb28e4c71 Add test_sortfilter from #950 2016-05-08 19:56:41 +02:00
Florian Bruhin
f306ca9b53 Fix lint 2016-05-08 11:14:42 +02:00
Florian Bruhin
b4272975f2 Revert "Use lists instead of tuples"
This reverts commit eb5bfc1659.
2016-05-08 11:09:47 +02:00
Florian Bruhin
4403f02ac5 Fix HostBlocker.on_config_changed with no datadir 2016-05-07 23:35:30 +02:00
Florian Bruhin
6d1764e732 Clear blocked hosts on start correctly 2016-05-07 23:31:35 +02:00
Florian Bruhin
f6544786c1 dict 2016-05-07 22:41:22 +02:00
Florian Bruhin
2d8bde62a5 docstring 2016-05-07 22:39:53 +02:00
Florian Bruhin
9e64e5eab4 Check CommandError exception value 2016-05-07 22:39:09 +02:00
Florian Bruhin
f4f329714d Reformat dicts 2016-05-07 22:38:37 +02:00
Florian Bruhin
1a03388fb5 Fix docstrings 2016-05-07 22:28:06 +02:00
Florian Bruhin
eb5bfc1659 Use lists instead of tuples 2016-05-07 22:12:28 +02:00
Florian Bruhin
bc8d19f003 Fix typo 2016-05-07 22:09:43 +02:00
Florian Bruhin
2ae8ecff71 Use qapp fixture in all adblock tests 2016-05-07 22:08:55 +02:00
Florian Bruhin
7db6f52fa1 Merge branch 'test_adblock' of https://github.com/jcorentin/qutebrowser into jcorentin-test_adblock 2016-05-07 22:06:43 +02:00
Ryan Roden-Corrent
98508bdd26 Allow flexible whitespace in color strings.
Allow a variable amount of whitespace for rgb, rgba, hsv, and hsva
strings in the config.
Previously only 'rgb(0, 0, 0)' was allowed. Now things like
'rgb(0,0,0)' are permitted.
The repeated 3-digit segments of the regexes were separated out to
reduce repetition and line length.
2016-05-03 23:15:39 -04:00
Florian Bruhin
48c7eee6f6 Release v0.6.2 2016-04-30 18:16:43 +02:00
Florian Bruhin
43d898aa63 Fix log tests 2016-04-30 17:45:45 +02:00
Florian Bruhin
2d5ffbfd02 Revert "Handle counts for special keys."
This reverts commit c881730fad.

This is just a temporary solution until we can properly fix this.

See #1464
2016-04-29 14:20:11 +02:00
Florian Bruhin
8b227f4ba4 Merge branch 'special_key_count' of https://github.com/rcorre/qutebrowser into rcorre-special_key_count 2016-04-28 22:22:23 +02:00
Florian Bruhin
076b486368 Merge branch 'issue-1412' of https://github.com/Kingdread/qutebrowser into Kingdread-issue-1412 2016-04-27 21:19:04 +02:00
Florian Bruhin
2a343cb3a1 Various code style improvements 2016-04-27 20:25:27 +02:00
Daniel Schadt
758fb94414 tests: add test for DiskCache with cache_dir=None 2016-04-27 00:04:02 +02:00
Florian Bruhin
ef91fa3821 Merge branch 'marks' of https://github.com/rcorre/qutebrowser into rcorre-marks 2016-04-21 20:05:41 +02:00
Ryan Roden-Corrent
c881730fad Handle counts for special keys.
Now 3<ctrl-o> will execute whatever <ctrl-o> is mapped to with count=3.
2016-04-19 23:39:02 -04:00
Florian Bruhin
6aaea2aa31 Fix HeaderDict with an empty value 2016-04-19 09:43:54 +02:00
Florian Bruhin
c5999443a1 Implement a HeaderDict config type
Supersedes #1132.
Fixes #1022.
2016-04-19 06:35:20 +02:00
Ryan Roden-Corrent
4b00a17d71 Fix MarkKeyParser crash when changing keyconfig.
Ensure MarkKeyParser implements on_keyconfig_changed, so it doesn't fail when
rebinding a key. It doesn't have keybindings, so the implementation is just
`pass`.

This also fixes a few flake8 style errors.
2016-04-17 21:04:08 -04:00
Florian Bruhin
c690e652dc Release v0.6.1 2016-04-10 21:25:32 +02:00
Florian Bruhin
1954ebd63c Fix test_last_window_session_none 2016-04-10 18:22:58 +02:00
Florian Bruhin
642dc46ba9 flake8: Add hacking 2016-04-08 07:35:53 +02:00
Florian Bruhin
00873fd000 Fix Proxy configtype test 2016-04-07 21:42:26 +02:00
Florian Bruhin
2f520f3b17 Rename test_editor.py to test_editor_unit.py 2016-04-05 19:49:01 +02:00
Florian Bruhin
c67edcf811 tests: Add v0.6.0 config to test_old_config 2016-04-04 18:16:31 +02:00
Florian Bruhin
19edea7343 Rename unit/misc/test_sessions.py to *_unit.py
Otherwise we get:

import file mismatch:
imported module 'test_sessions' has this __file__ attribute:
  /home/florian/proj/qutebrowser/git/tests/integration/features/test_sessions.py
which is not the same as the test file we want to collect:
  /home/florian/proj/qutebrowser/git/tests/unit/misc/test_sessions.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
2016-04-01 07:52:54 +02:00
Florian Bruhin
aad2407de1 Merge branch 'force-current-tab' of https://github.com/paretje/qutebrowser into paretje-force-current-tab 2016-04-01 06:13:08 +02:00
Kevin Velghe
0652637fbe Refactor unit tests for remove_blank_target 2016-04-01 01:32:27 +02:00
Florian Bruhin
89742beb4e pylint: useless-suppression in test_qt_javascript
When QtWebEngine is available, the suppression is useless.
2016-03-31 20:18:26 +02:00
Kevin Velghe
e90ad3d9c0 Complete coverage for webelem 2016-03-31 10:25:44 +02:00
Kevin Velghe
00f1e699d4 Add extra test to test_remove_blank_target 2016-03-30 23:46:02 +02:00
Kevin Velghe
dd4710d596 Fix test_remove_blank_target 2016-03-30 19:54:42 +02:00
Kevin Velghe
a432102be0 Add webelem tests for remove_blank_target 2016-03-30 19:08:37 +02:00
Florian Bruhin
5a5e8167dd Fix lint 2016-03-29 23:20:39 +02:00
Florian Bruhin
6c7e2492e9 Merge branch 'dirbrowser-issue-1334' of https://github.com/Kingdread/qutebrowser into Kingdread-dirbrowser-issue-1334 2016-03-29 22:38:04 +02:00
Florian Bruhin
fc7e75c355 Fix lint 2016-03-29 22:30:26 +02:00
Florian Bruhin
4067d38cb0 Add some tests for QtWebKit/Engine JS capabilities 2016-03-29 22:08:49 +02:00
Florian Bruhin
de5ecbf4e7 Fix lint 2016-03-29 21:10:29 +02:00
Florian Bruhin
f43cbed72f tests: Inherit HTTPPostStub from QObject
This way we can test the actual signals instead of calling
on_client_success by hand.
2016-03-29 19:22:28 +02:00
Florian Bruhin
25555682dc Merge branch 'master' of https://github.com/arsana7/qutebrowser into arsana7-master 2016-03-29 18:59:06 +02:00
Daniel Schadt
2db5b95552 tests: use "if not parent_elem"
Also add a new test for browsing the root directory
2016-03-29 12:36:43 +02:00
Florian Bruhin
f15fb16ad4 Fix small nitpick 2016-03-29 07:09:17 +02:00
Florian Bruhin
606471c4b6 Merge branch 'test_statusbar_url' of https://github.com/craftyguy/qutebrowser into craftyguy-test_statusbar_url 2016-03-29 07:07:45 +02:00
Clayton Craft
c811db5424 remove unused import 2016-03-28 15:31:28 -07:00
Clayton Craft
e0c0613db6 Added new test for simulating loading page and hover/unhover URL 2016-03-28 15:12:16 -07:00
Daniel Schadt
5e73a2ea37 dirbrowser: move parent dir logic to own function 2016-03-28 23:10:20 +02:00
Daniel Schadt
e97b10517f tests: use file_url for dirbrowser tests
Otherwise the tests will fail on windows.
2016-03-28 23:10:20 +02:00
Daniel Schadt
700756aa16 tests: add more cases for dirbrowser.is_root
The trailing slash might have an effect on the function result, so we
should have cases with/without the slash.
2016-03-28 23:08:54 +02:00
Clayton Craft
32304f36dd fix pylint failure 2016-03-25 16:35:49 -07:00
Florian Bruhin
387e35d3e5 Fix lint 2016-03-26 00:24:54 +01:00
Florian Bruhin
9edc5a665e Handle jinja's UndefinedError in jinja.render
We can get UndefinedError when a new function got added to the jinja
env (and gets called from a template) and the user did update the
on-disk templates but not restart qutebrowser yet.

In this case, let's show a special error page to the user and tell them
to do :report in the unlikely case it's actually a bug.

Fixes #1362.
See #1360.
2016-03-26 00:00:06 +01:00
Clayton Craft
4778ff6f9c Cleaned up url test and improved coveraged based on feedback 2016-03-25 15:56:39 -07:00
Florian Bruhin
86b12a302e Add a jinja.render helper
This simplifies some code and will make #1362 possible.
2016-03-25 14:29:30 +01:00
Clayton Craft
ff4e17190f Allow searching system-wide data path on Linux for userscripts 2016-03-24 13:22:00 -07:00
Clayton Craft
a78644a199 Implement statusbar.url test 2016-03-24 12:57:14 -07:00
Florian Bruhin
a932183909 Merge branch 'master' of https://github.com/haxwithaxe/qutebrowser into haxwithaxe-master 2016-03-18 06:17:54 +01:00
haxwithaxe
eed13467f3 allow {0} in search engine specification strings to allow multiple instances of the search term in the url 2016-03-17 20:38:05 -04:00
Florian Bruhin
74706abbc1 Fix lint 2016-03-17 22:10:58 +01:00
Florian Bruhin
0830b400fe Merge branch 'editor_crash_behaviour' of https://github.com/EliteTK/qutebrowser into EliteTK-editor_crash_behaviour 2016-03-17 21:40:17 +01:00
Florian Bruhin
99fadacda6 Merge branch 'multi_url_heuristic' of https://github.com/hcraT/qutebrowser into hcraT-multi_url_heuristic 2016-03-17 21:28:40 +01:00
Florian Bruhin
ed3fd71e6f Force showing of label in test_elided_text
It seems the paintEvent of TextBase never got called since we switched to using
fake_statusbar, breaking the 100% coverage check.
2016-03-15 08:29:33 +01:00
Florian Bruhin
569e7b11fb Make test_elided_text work with non-unicode output
When Qt detects it can't output unicode (via the locale?), it elides using
"..." instead of the unicode char "…". Now the test works in both scenarios.
2016-03-15 07:19:43 +01:00
Florian Bruhin
97ddd674dd Use fake_statusbar for test_elided_text
See #1313
2016-03-15 07:14:39 +01:00
Florian Bruhin
42a4c1ce4c Also test transform in test_configtypes_hypothesis
If validating works, we might as well also check if transforming does too.
2016-03-11 07:26:16 +01:00
Florian Bruhin
0c6d6367de Force qapp fixture for test_configtypes_hypothesis.
The test needs a QApplication
2016-03-11 07:17:11 +01:00
Tarcisio Fedrizzi
89ac5cba62 Adds test to reach 100% coverage on urlutils 2016-02-28 23:43:38 +01:00
avk
c9bb6d0111 tests for browser.network.pastebin - code refactor 2016-02-22 20:46:22 +01:00
avk
90c8078225 More tests for browser.network.pastebin 2016-02-22 16:09:57 +01:00
avk
6826a97910 Tests for browser.network.pastebin 2016-02-22 15:10:39 +01:00
Florian Bruhin
3ff419f685 Merge branch 'fix/ellipses-on-fullscreen' of https://github.com/NoctuaNivalis/qutebrowser into NoctuaNivalis-fix/ellipses-on-fullscreen 2016-02-22 11:50:26 +01:00
Felix Van der Jeugt
c52e93e296 no ellipsis is inserted in big windows 2016-02-15 22:52:28 +01:00
Florian Bruhin
5311576c34 Check pep257 via flake8.
We'll still keep the pydocstyle environment though until flake8-pep257 adds
support for that:

https://github.com/Robpol86/flake8-pep257/issues/6
2016-02-10 19:18:47 +01:00
Florian Bruhin
7f791dfcb8 Remove now obsolete test. 2016-02-10 07:06:34 +01:00
Florian Bruhin
5ae677376b Rerun TestPyQIODevice.test_qprocess if needed.
This adds a new pytest-rerunfailures dependency. For some reason, that test
sometimes fails with an empty string read, and I can't tell why.
2016-02-08 06:54:47 +01:00
Daniel Schadt
d02ec62e33 tests: fix tests for test_version
Broken since we changed pdfjs.PDFJSNotFound to have a parameter, which
was not given here.
2016-02-05 15:16:23 +01:00
Daniel Schadt
df8f87f8b6 tests: add tests for qutescheme 2016-02-05 15:14:23 +01:00
Florian Bruhin
e5e1a0d95c Reject hints -> chars containing duplicate chars
Fixes #1286.
2016-02-03 21:05:35 +01:00
Florian Bruhin
0b491f6caf Use json.dumps for logged fake clipboard.
For some reason, when comparing the repr in the two processes, we get different
results on OS X and Windows:

- expected: "fünf"
- "f\xfcnf" coming back from the subprocess on OS X
- "fnf" on Windows

Instead we're comparing the json dump now, which should be more predictable.
2016-02-03 20:54:35 +01:00
Florian Bruhin
79f83a033d Add a fake clipboard for tests
There are a lot of problems and flakiness with using a real clipboard.

Instead we now have a :debug-set-fake-clipboard command to set a text, and use
logging when getting the contents.

Fixes #1285.
2016-02-03 20:27:11 +01:00
Florian Bruhin
67efd1c5e0 Fix lint. 2016-02-02 19:23:24 +01:00
Florian Bruhin
65a4c71488 Merge branch 'master' of https://github.com/NoctuaNivalis/qutebrowser into NoctuaNivalis-master 2016-02-02 18:58:16 +01:00
Florian Bruhin
37bb26bdd5 Add a test in test_editor.py. 2016-02-02 06:53:12 +01:00
Florian Bruhin
ad290e8702 Merge branch 'relax-editor-templating' of https://github.com/Olical/qutebrowser into Olical-relax-editor-templating 2016-02-02 06:49:57 +01:00
Florian Bruhin
312daca2b0 fuzzy_url: Raise InvalidUrlError on empty URLs.
Before we raised QtValueError (via qtutils.ensure_valid), but maybe there are
more callers out there which call fuzzy_url with an empty input - and it makes
more sense to raise InvalidUrlError which gets displayed to the user than
raising QtValueError which is more like an assertion.
2016-02-02 06:38:48 +01:00
Oliver Caldwell
a617bc3ef4 Add missing commas
I haven't written Python in quite a long time :|
2016-02-01 21:41:14 +00:00
Oliver Caldwell
5474f902dd Add more tests for new editor config 2016-02-01 21:36:24 +00:00
Oliver Caldwell
a14f8a201e Merge remote-tracking branch 'TheCompiler/master' into relax-editor-templating 2016-02-01 21:19:50 +00:00
Daniel Schadt
449a54c7d0 pdfjs: add file path to version information
Shows "bundled" if the bundled version is used.
2016-02-01 17:28:18 +01:00
Oliver Caldwell
54ff2aa46c Merge remote-tracking branch 'TheCompiler/master' into relax-editor-templating 2016-01-31 22:43:58 +00:00
Oliver Caldwell
a9a42e0a99 Removed invalid placeholder test 2016-01-31 22:36:58 +00:00
Oliver Caldwell
84c44f3395 Remove invalid test parameter 2016-01-31 22:23:35 +00:00
Florian Bruhin
4d9ea06768 tests: Make test IDs predictable.
This means we could use xdist in the future.
2016-01-25 22:15:31 +01:00
Florian Bruhin
7dca8d7329 Fix lint. 2016-01-24 17:30:59 +01:00
Florian Bruhin
86f03c7d81 Merge branch 'master' of https://github.com/mikeri/qutebrowser into mikeri-master 2016-01-24 17:01:35 +01:00
Corentin Julé
6fd8dc4e57 Correct test_config_change 2016-01-23 16:34:05 +01:00
Corentin Julé
47261dbd30 Code cleanup / Good practices 2016-01-23 16:15:19 +01:00
Florian Bruhin
58fb2826ee flake8: Add flake8-putty plugin.
Apply a bit of putty to flake8.
https://pypi.python.org/pypi/flake8-putty/
2016-01-22 17:33:58 +01:00
Florian Bruhin
526441bcae Fix new flake8 lint.
For some reason these issues weren't shown with pytest-pep8/flakes.
2016-01-22 17:33:58 +01:00
Michael Ilsaas
4ad2d63c8a Shortened urlincdec tests to one and some styling 2016-01-21 18:37:46 +01:00
Michael Ilsaas
1ecccc1133 Fix: decrement url test was set to increment. 2016-01-21 17:15:48 +01:00
Florian Bruhin
4c64619263 tests: Fix configdir None tests for UserStyleSheet. 2016-01-20 19:55:34 +01:00
Michael Ilsaas
c33e9555a1 Tester for url increment/decrement with zeroes 2016-01-20 19:38:03 +01:00
Florian Bruhin
a249d8d426 tests: Ignore another Qt warning by hypothesis. 2016-01-20 08:06:36 +01:00
Florian Bruhin
eb276df876 Handle empty term in urlutils._get_search_url.
Fixes #1239.
2016-01-19 07:03:43 +01:00
Florian Bruhin
8a757c8603 Release v0.5.1. 2016-01-18 22:12:52 +01:00
Felix Van der Jeugt
7ad871fab1 Merge remote-tracking branch 'source/master' 2016-01-18 21:45:47 +01:00
Florian Bruhin
c8538bdbb8 Fix config validation for String types.
Fixes #1231.
2016-01-18 07:29:15 +01:00
Felix Van der Jeugt
9a889c6866 extended tests to cover new file argument 2016-01-17 20:38:33 +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
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
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
ff2024a565 Add socket IDs to ipc debug messages. 2016-01-08 12:02:36 +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
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
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
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
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
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
e6284ed5d4 tests: Improve some ugly test IDs. 2015-12-16 22:21:29 +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