Marshall Lochbaum
8da8441623
Merge auto-open option into show
2016-08-09 13:11:32 -04:00
Marshall Lochbaum
d98c81c9d6
Correct widget behavior when there is no completion
2016-08-09 13:03:38 -04:00
Florian Bruhin
fb3da578c5
Fix lint
2016-08-09 17:28:14 +02:00
Jan Verbeek
8e4733f483
Merge https://github.com/The-Compiler/qutebrowser into clip
2016-08-09 14:36:01 +02:00
Florian Bruhin
c8a92a0851
Fix test_assemble
2016-08-09 13:23:46 +02:00
Marshall Lochbaum
80db69904d
Move auto-open handling to CompletionView from Completer
2016-08-08 16:56:11 -04:00
Florian Bruhin
58fb41ab9d
tests: Fix webkitelem test for tagName
2016-08-08 15:34:45 +02:00
Florian Bruhin
9d43becc25
Merge branch 'completion-item-focus' of https://github.com/rcorre/qutebrowser into rcorre-completion-item-focus
2016-08-08 15:21:35 +02:00
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