Commit Graph

275 Commits

Author SHA1 Message Date
Ryan Roden-Corrent
d89898ef7d Implement delete_cur_item for sql completion.
This re-enables bookmark/quickmark deletion for url completions via the new SQL
interface.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
fe80878788 Implement custom where clause in SQL.
Allow categories to specify a WHERE clause that applies in addition to the
pattern filter. This allows the url completion model to filter out redirect
entries.

This also fixed the usage of ESCAPE so it applies to all the LIKE statements.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
9f27a9a5d7 Implement column selectors for sql completion.
A SQL completion category can now provide a customized column expression for
the select statement. This enables the url model to format timestamps, as well
as rearrange the name and url in the quickmark section.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
3f6f03e325 Respect web-history-max-items with SQL.
Use a LIMIT with the sql competion model to limit history entries as the old
completion implementation did.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
df995c02a3 Get rid of varargs in sql.run_query.
Things are clearer when just passing a list.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
b70d5ba901 Use QSqlQueryModel instead of QSqlTableModel.
This allows setting the query as a QSqlQuery instead of a string, which allows:

- Escaping quotes
- Using LIMIT (needed for history-max-items)
- Using ORDER BY (needed for sorting history)
- SELECTing columns (needed for quickmark completion)
- Creating a custom select (needed for history timestamp formatting)
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
52d7d1df0c Use SQL completer for quickmarks/bookmarks. 2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
839d49a8ac Fix up pylint/flake8 for completion revamp. 2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
b381148e06 Unittest CompletionView.completion_item_del.
There were no unit tests for this and the various ways it can fail, and I'm
about to screw with it a bit.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
a774647c26 Get test_models mostly working again.
- Adjust _check_completions to work for CompletionModel and SqlCompletionModel
- Move sql initialization into a reusable fixture
- Remove the bookmark/quickmark/history stubs, as they're now handled by sql
- Disable quickmark/bookmark model tests until their completion is ported to
  sql.
- Disable urlmodel tests for features that have to be implemented in SQL:
    - LIMIT (for history-max-items)
    - Configurable column order (for quickmarks)
    - Configurable formatting (for timestamp-format
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
3005374ada Simplify sorting logic in sortfilter.
For URL completion, time-based sorting is handled by the SQL model.
All the other models use simple alphabetical sorting. This allowed cleaning up
some logic in the sortfilter, removing DUMB_SORT, and removing the
completion.Role.sort.

This also removes the userdata completion field as it was only used in url
completion and is no longer necessary with the SQL model.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
6e1ea89ca1 Implement SQL completion model.
This model wraps one or more SQL tables and exposes data in a tiered
manner that can be consumed by the tree view used for completion.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
3b30b42211 Remove completion.instances, usertypes.Completion.
The new completion API no longer needs either of these. Instead of
referencing an enum member, cmdutils.argument.completion now points to
a function that returnsthe desired completion model.
This vastly simplifies the addition of new completion types. Previously
it was necessary to define the new model as well as editing usertypes
and completion.models.instances. Now it is only necessary to define a
single function under completion.models.

This is the next step of Completion Model/View Revamping (#74).
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
08bb3f4f19 Implement completion models as functions.
First step of Completion Model/View revamping (#74). Rewrite the
completion models as functions that each return an instance of a
CompletionModel class.

Caching is removed from all models except the UrlModel. Models other
than the UrlModel can be generated very quickly so caching just adds
needless complexity and can lead to incorrect results if one forgets to
wire up a signal.
2017-06-19 07:42:12 -04:00
Florian Bruhin
af7923de4d tests: Use pytest.param 2017-05-23 08:08:46 +02:00
Florian Bruhin
822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Ryan Roden-Corrent
120379dd21 Benchmark url completion.
This benchmark simulates what I expect to be the most common use-case for url
completion: opening completion and entering several letters.
2017-05-03 07:43:02 -04:00
Florian Bruhin
1d0f187fab Adjustments for new pylint version 2017-04-13 18:22:16 +02:00
Florian Bruhin
ca4f249c30 Use three-argument form of monkeypatch.*attr 2017-03-01 11:33:41 +01:00
Ryan Roden-Corrent
fbc084e416 Remove :<count>:cmd syntax support.
CommandRunner.parse had some logic for handling commands of form
:<count>:cmd. However, this complicated the parsing logic for something
that appears to only be used in tests. One could use it in a
userscript, but this is unlikely as it is undocumented. Removing
support for this simplifies the logic of parse.

The commnd `run-with-count` is added to provide this functionality.
It works like `repeat` but passes the count along to the command
instead of running the command multiple times.

This resolves #1997: Qutebrowser crashes when pasting commands.
This bug was caused by excess stripping of ':' from the command string
by _parse_count.
2016-10-10 08:02:30 -04:00
Florian Bruhin
750dfd98af Generalize statusbar-attached website overlays
We already had some duplicated logic for completion/keyhint/messageview,
and plan to add prompt overlays too now - so here we refactor related
code to have a list of overlays instead, which are all
resized/positioned by the mainwindow when needed.

This also changes the size management, which gets moved into the
sizeHint of the respective overlay widgets.
2016-09-22 17:04:39 +02:00
Ryan Roden-Corrent
1d2cf3b648 Completer: don't try to partition search.
Exit before trying to partition if the command prefix is not ':'.

Resolves #1969:
'TypeError with refactored completion when searching for command'
2016-09-21 07:08:34 -04:00
Florian Bruhin
9db3d3f7c3 Merge branch 'completion_tests' of https://github.com/rcorre/qutebrowser into rcorre-completion_tests 2016-09-15 16:47:32 +02:00
Ryan Roden-Corrent
a7eea6a0c1 Rewrite test_on_next_prev_item after refactoring.
Check the value of the signal emitted after each one of a series of
next/prev_item calls.
2016-09-15 07:41:56 -04:00
Ryan Roden-Corrent
a9771007b1 Pass string, not index from on_selection_changed.
Simplify the CompletionWidget/Completer interface by changing
on_selection_changed to pass the newly selected text rather than the
index of the newly selected item.
This moves the logic from Completer to CompletionWidget but simplifies
the interaction between the two and makes testing easier.
2016-09-14 22:55:07 -04:00
Ryan Roden-Corrent
6646bbfe1f Test config completion with a ValueList.
The help, section, and option completion models behavee differently
with a ValueList than with a KeyValue, but previously we only tested
KeyValue.
2016-09-14 17:26:56 -04:00
Ryan Roden-Corrent
657859524f Make completion/test_models more rigorous.
It was checking that every expected item was in the actual item list,
but not visa-versa. This meant that extra completion items could show
up without failing the test.

This caught one bad test case. Bind completion includes aliases, but
the test did not expect this.
2016-09-14 17:26:56 -04:00
Ryan Roden-Corrent
e23d611b37 Strip quotes from completion pattern.
Given a commandline like:
`:set general editor "gvim -f"|`, the pattern should be 'gvim -f'
rather than '"gvim -f"'.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
e65aba74fd Test pattern for Completion.update_completion.
In the update_completion unit test, verify the `pattern` parameter as
well as the `model`.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
b867b87955 Don't crash Completer on unknown command.
The CommandRunner's fallback parsing behavior treated whitespace
differently than the normal flow. When a user entered an unknown
command, trailing whitespace would be stripped and the cmdline length
would be less than the cursor position.

This is fixed by making the fallback use the ShellLexer just as the
'normal' parsing does.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
52fdad8186 Test on_selection_changed with maxsplit 2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
d651cc75b0 Fix flake8/pylint errors. 2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
808a645b40 Fix quick-complete highlighting quirk.
When the commandline reads ':open |', quick-completing the only offered
completion will set the commandline to ':open some_url |'. Since `open`
has `maxsplit=0`, everything after ':open' is (correctly) treated as
one argument. This means completion is opened again with 'some url '
as the pattern (note trailing whitespace), which makes the comletion
menu 'flicker' and stay open even though it was 'supposed' to quick
compelte.

This is fixed by ignoring the next completion request if we just
completed something after maxsplit (because we don't expect any more
completions after the last split).

Resolves #1519.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
127412d91c Simplify update_completion.
Remove the class variables _cursor_part and _empty_item_index. Instead,
split up the commandline around the cursor whenever that information is
needed. Using locals instead of class variables makes the logic easier
to follow and ends up requiring much less code.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
581d7659ba Clean up Completer.on_selection_changed.
Remove the dependency on the class variables _empty_item_index
and _cursor_part to make the code easier to follow. If
_update_completion is refactored in a similar way these variables can
be removed.
2016-09-12 22:19:44 -04:00
Ryan Roden-Corrent
eb384fdda0 Better Completer.on_selection_changed testing.
Preparation for refactoring.
2016-09-12 22:19:44 -04:00
Florian Bruhin
71a89bd418 *Really* fix completion with multiple words.
Turns out re.escape also escapes spaces, so we'd need to replace '(\\ )'
groups after escaping. At this point it's easier to just combine spaces
before escaping the pattern.

Fixes #1934.
Supersedes #1935.
2016-09-09 09:03:18 +02:00
Florian Bruhin
0a3853fcb7 Fix handling of spaces in completion
This is a regression introduced in
faa052ad6f.

Fixes #1934.
2016-09-08 21:59:18 +02:00
Florian Bruhin
654260dd2e Add blank line 2016-09-01 07:09:06 +02:00
Ryan Roden-Corrent
48fe309a48 Regression test for repeated completion.
Add a completionwidget unit test for #1812: help completion repeatedly
completes.

Addresses #1899.
2016-08-31 22:16:26 -04:00
Florian Bruhin
b9282587d0 Merge branch 'auto-open-fixes' of https://github.com/mlochbaum/qutebrowser into mlochbaum-auto-open-fixes 2016-08-29 07:12:14 +02:00
Marshall Lochbaum
994c6e35d9 Test completion show when calling next with no completion 2016-08-21 23:05:56 -04:00
Marshall Lochbaum
fb9867b6a7 Add tests for completion show with no rows 2016-08-21 22:57:16 -04:00
Marshall Lochbaum
cbecd48871 Refactor Completer/CompletionView interface, removing set_pattern() 2016-08-21 22:56:18 -04:00
Florian Bruhin
cfbd02eaba tests: Clean up test_column_widths 2016-08-20 22:08:07 +02:00
Marshall Lochbaum
e4cec43cf4 Add quick-complete to completion widget tests 2016-08-20 01:27:39 -04:00
Marshall Lochbaum
2db0ec8b6d Fix test_completion_show name and docstring 2016-08-20 01:13:32 -04:00
Marshall Lochbaum
64d53e4cf9 Add unit test for completion show 2016-08-20 01:01:38 -04:00
Marshall Lochbaum
08b348be50 Merge branch 'master' into auto-open-fixes 2016-08-19 22:50:26 -04:00
Ryan Roden-Corrent
7b3839b44b Focus completion by category.
Implement `completion-item-focus next-category` and
`completion-item-focus prev-category` to jump through completions by
category rather than by item.

Resolves #1567.
2016-08-15 07:14:28 -04:00
Florian Bruhin
f3c32308d3 Merge branch 'complete-hidden-commands' of https://github.com/rcorre/qutebrowser into rcorre-complete-hidden-commands 2016-08-10 15:38:46 +02:00
Florian Bruhin
ad5008152c Move browser.webkit.history to browser.history 2016-08-10 14:45:52 +02:00
Ryan Roden-Corrent
0c43ca9f09 Don't sort command completions in models.
The sortfilter already handles sorting, there is no reason to pre-sort
the entries in the model.
2016-08-10 06:58:34 -04:00
Ryan Roden-Corrent
97a971624b Show bindings for aliases in completion.
Command completions for `:bind` and `:` will now show bindings for
aliases. The binding is only included if it is bound to that alias, not
if it is bound to the command the alias points to.
2016-08-10 06:56:44 -04:00
Ryan Roden-Corrent
709470fbe6 Clean up miscmodels and test_models.
- Split up a long conditional into multiple variables.
- Fix a small typo in a related test.
- Remove a trailing comma from an argument list.
2016-08-10 06:56:44 -04:00
Ryan Roden-Corrent
8dbc368d08 Refactor duplicate code for command completion.
Consolidate the logic used to generate the command completion category
into one place. This is shared by CommandCompletionModel,
HelpCompletionModel, and BindCompletionModel.
2016-08-10 06:56:44 -04:00
Ryan Roden-Corrent
0ea61d5f15 Show hidden commands in completion for :bind.
There is a fair amount of duplicate code around command completion that
could probably be refactored.

Resolves #1707.
2016-08-10 06:56:44 -04:00
Ryan Roden-Corrent
dd9470af94 Show hidden commands in help completion.
Hidden commands are not shown in command completion as they typically
would not be run directly. However, a user might still might like to see
help for them if, for example, they are writing a script or creating a
binding.

Addresses #1707.
2016-08-10 06:55:46 -04:00
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
Marshall Lochbaum
80db69904d Move auto-open handling to CompletionView from Completer 2016-08-08 16:56:11 -04: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
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
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
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
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
693210920c Fix completion widget unit tests 2016-08-01 16:29:47 +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
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
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
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
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
4e5a7a891e tests: Use FakeWebTab for stubbing 2016-07-07 18:32:52 +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
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
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
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
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
a5f2ac5f03 Adjust copyright years. 2016-01-04 07:12:39 +01:00
Florian Bruhin
2c5269acd6 Reorganize tests directory. 2015-08-18 20:19:02 +02:00