Florian Bruhin
237362663a
Fix test_configfiles.test_init on Windows
2017-07-10 20:37:36 +02:00
Yashar Shahi
a631c971d9
Add tests for show messages longer
...
Add tests for "Show messages longer if there are multiple of them."
2017-07-10 20:52:42 +04:30
Florian Bruhin
e81dcccace
Add a test for a None currentWidget with backforward widget
2017-07-10 09:29:45 +02:00
Florian Bruhin
5fb6cb713b
Hide back/forward widget when there's no text
2017-07-10 07:59:56 +02:00
Florian Bruhin
0e8175b8eb
Update docstrings/docs
2017-07-09 23:27:34 +02:00
Daniel Hahler
b3a9e09d6c
Add statusline widget for back/forward indicator
...
Fixes https://github.com/qutebrowser/qutebrowser/issues/2737 .
2017-07-09 22:38:44 +02:00
Florian Bruhin
bb567a61b6
Fix ipc test coverage
2017-07-09 22:09:31 +02:00
Florian Bruhin
84c2289aa5
Merge branch 'master' of https://github.com/iordanisg/qutebrowser
2017-07-09 12:56:52 +02:00
Florian Bruhin
cd063c74d9
Why is my commit -a broken
2017-07-09 12:54:19 +02:00
Florian Bruhin
6a2163d36f
ipc: Remove support for connecting to legacy servers
2017-07-09 12:49:47 +02:00
Ryan Roden-Corrent
cf4ac1a5b7
SQL code review changes.
...
- use mocker.Mock instead of mock.Mock to avoid an extra import
- attach model to validator sooner so it can validate changes in the
model during the test
2017-07-08 16:34:38 -04:00
Iordanis Grigoriou
c9fd182dba
Adjust suggested_fn_from_title, add tests
2017-07-08 16:28:58 +02:00
Ryan Roden-Corrent
f9f8900fe9
More sql code review fixes.
...
- remove outdated comment
- fix sql init error message
- clean up history text import code
- fix test_history file path in coverage check
- use real web history, not stub, for completion model tests
- use qtmodeltester in sql/list_category tests
- test url encoding in history tests
- fix test_clear by using a callable mock
- remove test_debug_dump_history_oserror as the check is now the same as
for the file not existing
- rename nonempty to data in test_completionmodel
- add more delete_cur_item tests
- test empty option/value completion
2017-07-08 09:57:32 -04:00
Florian Bruhin
ad615941a2
Replace OS X with macOS
2017-07-08 11:12:43 +02:00
Ryan Roden-Corrent
515e82262d
Merge remote-tracking branch 'upstream/master' into really_complete
2017-07-07 20:42:21 -04:00
Florian Bruhin
215503ba59
Remove now useless suppression
2017-07-07 15:21:18 +02:00
Iordanis Grigoriou
82d194cf2e
Improve function docstring, add more tests
2017-07-06 21:37:11 +02:00
Iordanis Grigoriou
3bfafb5e50
Refactor suggested_fn_from_title, add unit tests
2017-07-06 17:41:54 +02:00
Florian Bruhin
338d62204e
Make TestModuleVersions in test_version more maintainable
2017-07-06 12:36:11 +02:00
Florian Bruhin
66168a5b49
Add test ids to test_version_output
2017-07-06 12:25:11 +02:00
Florian Bruhin
911e59b0f4
Improve version output without SSL support
2017-07-06 12:23:08 +02:00
Florian Bruhin
94951d92a1
Simplify arg handling in test_version_output
2017-07-06 12:15:42 +02:00
Ryan Roden-Corrent
dc4472470e
Merge remote-tracking branch 'upstream/master' into really_complete
2017-07-05 08:45:57 -04:00
Ryan Roden-Corrent
81f5b7115f
Add spec=[] to two mock functions in tests.
2017-07-05 08:44:56 -04:00
Florian Bruhin
28410b8533
Release v0.11.0
2017-07-04 18:02:34 +02:00
Florian Bruhin
0cdd3ff82f
Update some more references to old config options
2017-07-04 16:46:02 +02:00
Florian Bruhin
cff61fa0bc
Fix pylint
...
This also reverts commit 8df0b063be
.
2017-07-04 15:34:10 +02:00
Florian Bruhin
88b878098d
Implement pretty-printing of configtypes for the doc
...
This is also needed to make the docs environment work on Travis - as otherwise,
doc generation wasn't deterministic because of changing dict key order.
2017-07-04 15:09:23 +02:00
Florian Bruhin
f98b8a240e
Fix flake8
2017-07-04 15:09:23 +02:00
Florian Bruhin
79c11d6008
Skip test_configdata.test_init_benchmark on Travis in Docker
...
See #2777
2017-07-04 15:09:23 +02:00
Florian Bruhin
65585b313d
test_configtypes: Rename test_to_py to _valid for consistency
2017-07-04 15:09:23 +02:00
Florian Bruhin
9ac2dbcc80
Disallow surrogate escapes in dicts and lists in the config
...
In Dict.to_str() and List.to_str() we use json.dump to get a value. However,
JSON includes surrogate escapes in the dumped values, which breaks round trips.
>>> yaml.load(json.dumps({'\U00010000': True}))
{'\ud800\udc00': True}
>>> yaml.load(json.dumps({'\U00010000': True}, ensure_ascii=False))
yaml.reader.ReaderError: unacceptable character #x10000: special characters are not allowed
See:
https://stackoverflow.com/a/38552626/2085149
https://news.ycombinator.com/item?id=12798032
2017-07-04 15:09:23 +02:00
Florian Bruhin
fa0f4e1101
Improve test_configtypes.TestDict
...
We didn't have to_py tests there before.
2017-07-04 15:09:23 +02:00
Florian Bruhin
f00e91e85e
Don't set valid_values in test_configtypes.TestList
...
Most of the time we want to check values without them being outright rejected by
ValidValues.
2017-07-04 15:09:23 +02:00
Florian Bruhin
05f4f2e742
Fix TestDict.test_hypothesis_text for unordered dicts
2017-07-04 15:09:23 +02:00
Florian Bruhin
ea2b9f5596
Remove old comment
...
The recursion is caught in test_config
2017-07-04 15:09:15 +02:00
Florian Bruhin
0528a800f2
Fix config things relying on dict order
2017-07-04 15:08:04 +02:00
Florian Bruhin
8933b4c5da
Avoid calling configdata.init() in tests
...
It takes unnecessary time (20ms without C extensions) to initialize it over and
over again - and for some reason, it takes 20s (!) on Travis.
2017-07-04 15:08:04 +02:00
Florian Bruhin
9db4a8cb43
Clean up test_cache
2017-07-04 15:08:04 +02:00
Florian Bruhin
9dfe4429d7
Import qutebrowser.app in conftest
2017-07-04 15:08:04 +02:00
Florian Bruhin
b42265212b
Update test_keyhints for new config
...
This also makes the keyhint display things sorted
2017-07-04 15:08:04 +02:00
Florian Bruhin
4bebfd8d5f
Update test_modeparsers for new config
2017-07-04 15:08:04 +02:00
Florian Bruhin
d5cd0b19b0
Update test_basekeyparser for new config
2017-07-04 15:08:04 +02:00
Florian Bruhin
22b0f2fd24
Various simple test updates for new config
...
test_cache
test_cookies
test_webkitelem
test_cmdutils
test_runners
test_completionwidget
test_messageview
test_editor
test_miscwidgets
test_sessions
test_urlutils
test_utils
test_prompt
statusbar/test_*
test_cmdhistory
test_tabwidget
test_tab
test_downloads
test_networkmanager
2017-07-04 15:08:04 +02:00
Florian Bruhin
1663280f53
Update test_shared for new config
...
Also, make accept_language none_ok=True like it was in the old configdata.py
2017-07-04 15:08:04 +02:00
Florian Bruhin
7dd5e4b2e6
Skip broken completion tests
...
This skips test_completer and test_models - we'll reintroduce them when merging
the new completion.
2017-07-04 15:08:04 +02:00
Florian Bruhin
ff05560047
Update test_adblock for new config
...
This required some changes on how URLs are handled during those tests. Before,
we simply could return a path and (since we had a patched QNAM), nobody
complained.
Now this actually needs to be a valid URL, so we use
https://www.example.com/path everywhere instead.
2017-07-04 15:08:04 +02:00
Florian Bruhin
78d7ac311f
Use fonts.monospace properly
2017-07-04 15:08:04 +02:00
Florian Bruhin
d641652a92
More test_config improvements
2017-07-04 15:08:04 +02:00
Florian Bruhin
c214acd899
Remove config from objreg
2017-07-04 15:08:04 +02:00
Florian Bruhin
f8a88ae042
Clean up objreg properly in config tests
2017-07-04 15:08:04 +02:00
Florian Bruhin
54adf3898a
Add test_configfiles.py
2017-07-04 15:08:04 +02:00
Florian Bruhin
1a492e9f4a
Re-add backend checks to new config
2017-07-04 15:08:04 +02:00
Florian Bruhin
556f49d367
Add PACFetcher.fetch
...
Let's not try to download proxies during tests...
2017-07-04 15:08:04 +02:00
Florian Bruhin
215fd2f055
More test_config fixes/tests
2017-07-04 15:08:04 +02:00
Florian Bruhin
009ed3584d
Reorder tests
2017-07-04 15:08:04 +02:00
Florian Bruhin
2b9b54cf6b
Tests and improvements for ConfigContainer
2017-07-04 15:08:03 +02:00
Florian Bruhin
4495e721d8
Tests and fixes for config.Config
2017-07-04 15:08:03 +02:00
Florian Bruhin
07d0ea6a54
Unit tests and improvements for :bind/:unbind
2017-07-04 15:08:03 +02:00
Florian Bruhin
3edebce833
Add tests for :set
2017-07-04 15:08:03 +02:00
Florian Bruhin
31b999ea59
Tests and improvements for KeyConfig
2017-07-04 15:08:03 +02:00
Florian Bruhin
725ffef5f3
Use a real config object in unit tests
2017-07-04 15:08:03 +02:00
Florian Bruhin
978013e750
Fix CommandParser and don't use a generator
2017-07-04 15:08:03 +02:00
Florian Bruhin
a8c7e8ba05
Add first config tests
2017-07-04 15:08:03 +02:00
Florian Bruhin
28670f8e48
Move config.style into config.config and refactor it
2017-07-04 15:08:03 +02:00
Florian Bruhin
81d6406e14
Update test_stylesheet
2017-07-04 15:08:03 +02:00
Florian Bruhin
a5c8a52dd5
Update config_stub for tests
2017-07-04 15:08:03 +02:00
Florian Bruhin
0dc95aceed
Clean up old test_config.py
2017-07-04 15:08:03 +02:00
Florian Bruhin
065f82f485
Fix endless recursion while validating aliases
2017-07-04 15:08:03 +02:00
Florian Bruhin
ac78039171
Use aliases for :w and :q
2017-07-04 15:08:03 +02:00
Florian Bruhin
ac64ea287a
Rename tabs.new_position/_explicit to .related/.unrelated
2017-07-04 15:08:03 +02:00
Florian Bruhin
441b3a4df4
Allow missing fixed_keys for configtypes.Dict
...
We just fill them up with a None value for the value type, so we can e.g. only
specify a subset of modes for bindings and the rest is {}.
2017-07-04 15:08:03 +02:00
Florian Bruhin
9d8b76e497
Simplify _none_value for List/Dict configtypes
...
We don't need to check for fixed_keys/required_keys in get_obj (only get_py),
and we don't need to care about mutability in get_py.
2017-07-04 15:08:03 +02:00
Florian Bruhin
da0a2b8578
Handle {} and [] with none_ok for configtypes.Dict/List
2017-07-04 15:08:03 +02:00
Florian Bruhin
2ba637891a
Add required_keys for configtypes.Dict
2017-07-04 15:08:03 +02:00
Florian Bruhin
7ee222af88
Return [] for none-values for configtypes.List
2017-07-04 15:08:03 +02:00
Florian Bruhin
9cbacf3264
Use {} for none-dicts and fix keybindings
2017-07-04 15:08:03 +02:00
Florian Bruhin
127db2fe42
Be a bit more relaxed about values for Perc
...
We now allow float/int for objects, and strings without a trailing % sign.
2017-07-04 15:08:03 +02:00
Florian Bruhin
9bd438618a
Add a test for DuplicateKeyError
2017-07-04 15:08:03 +02:00
Florian Bruhin
2a40401398
Fix config tests for new Command type
2017-07-04 15:08:03 +02:00
Florian Bruhin
383968d948
Add a Key config type
...
Make sure any key we get from the config is normalized).
2017-07-04 15:08:02 +02:00
Florian Bruhin
d0904a9f67
Adjust test settings
2017-07-04 15:08:02 +02:00
Florian Bruhin
bc8176ff21
Remove most legacy config code
2017-07-04 15:08:02 +02:00
Florian Bruhin
f5d2c48bbb
Fix new keyconfig issues
2017-07-04 15:08:02 +02:00
Florian Bruhin
dc74a55b84
Fix remaining configtypes issues
2017-07-04 15:08:02 +02:00
Florian Bruhin
3392ccc58b
test_configtypes fixes
2017-07-04 15:08:02 +02:00
Florian Bruhin
ecba175b16
Test and fix configtypes to_str.
2017-07-04 15:08:02 +02:00
Florian Bruhin
d69c6d0c66
Reorganize how configtypes store their data
...
Now the "object" kind of value (like in YAML) is stored internally, and that's
the canonical value. The methods changed their meaning slightly, see the
docstring in configtypes.py for details.
2017-07-04 15:08:02 +02:00
Florian Bruhin
1cbb4ece4b
Force configtype.Dict keys to be strings
2017-07-04 15:08:02 +02:00
Florian Bruhin
41655e7852
Fix handling of none_ok in List/Dict
...
We now always return None (and '' as string) when the user configured an empty
list or dict.
2017-07-04 15:08:01 +02:00
Florian Bruhin
8ea3d92697
Initial implementation of to_str for configtypes
2017-07-04 15:08:01 +02:00
Florian Bruhin
fede64ba7a
Add test for configdata.is_valid_prefix
2017-07-04 15:08:01 +02:00
Florian Bruhin
18eb133811
configdata: Make sure default values are valid
2017-07-04 15:08:01 +02:00
Florian Bruhin
0857a45b0a
configtypes: parse regex flags properly
2017-07-04 15:08:01 +02:00
Florian Bruhin
6733e92b50
Handle files correctly in utils.yaml_dump
2017-07-04 15:08:01 +02:00
Florian Bruhin
001312ca82
Disallow Booleans for configtypes.Int.from_py
2017-07-04 14:42:56 +02:00
Florian Bruhin
4e729bb9ec
Back to using json in test_configtypes
...
It returns one-line data and is YAML compatible
2017-07-04 14:42:56 +02:00
Florian Bruhin
dfee857466
Make utils.yaml_dump return str
2017-07-04 14:42:56 +02:00
Florian Bruhin
05dc94ccc4
Improve configtypes tests
2017-07-04 14:42:56 +02:00
Florian Bruhin
7416164aca
Rename old validate tests
2017-07-04 14:42:56 +02:00
Florian Bruhin
71f2e8c577
None validation fixups for test_configtypes
2017-07-04 14:42:56 +02:00
Florian Bruhin
61ba92ae18
configtypes: Separate str/py basic validation
...
This also ensures the behavior for none_ok is consistent.
2017-07-04 14:42:56 +02:00
Florian Bruhin
cdbd64a30d
Move test_configtypes_hypothesis to test_configtypes
2017-07-04 14:42:56 +02:00
Florian Bruhin
7e7fbf106b
Fix lint and old config options
2017-07-04 14:42:56 +02:00
Florian Bruhin
63bdee8b55
Initial configtype tests update
2017-07-04 14:42:56 +02:00
Ryan Roden-Corrent
1e1335aa5e
Make various SQL code review changes.
...
- Fix outdated comments
- Use mock specs when possible
- More precise error message check in test_import_txt_invalid.
- Fix copyright message
- Tweak missing pyqt error message
- Dead code: remove group_by and where from sqlcategory.
With the new separate completion table, these are no longer used.
- Move test_history out of webkit/. History is no longer purely webkit
related, it could be webengine.
2017-07-03 09:45:08 -04:00
Ryan Roden-Corrent
a34df34208
Fix various test/flake8/pylint errors.
2017-07-03 08:12:47 -04:00
Florian Bruhin
3b53ec1cb6
Skip tests with permission changes if they didn't work
...
This e.g. wouldn't work inside of a Docker container otherwise.
2017-07-03 10:07:40 +02:00
Florian Bruhin
1022b7ea32
Make jinja templating more strict
...
This ensures we actually know when an AttributeError happens.
It also changes most external code to use the correct environment, rather than
simply creating a jinja2.Template, which wouldn't use the more tightened
environment.
2017-07-02 22:17:33 +02:00
Florian Bruhin
aa6f229e6b
Add utils.yaml_{load,dump}
2017-07-02 22:17:33 +02:00
Florian Bruhin
3e3685b68b
Initial configexc refactoring
2017-07-02 22:17:33 +02:00
Florian Bruhin
5ec47da127
Get rid of configtypes.AutoSearch and IgnoreCase
2017-07-02 22:17:33 +02:00
Florian Bruhin
938946c48b
configdata: Add check for shadowing keys
2017-07-02 22:17:33 +02:00
Florian Bruhin
52f6ea2525
Initial parsing
2017-07-02 22:17:33 +02:00
Ryan Roden-Corrent
c1f5e77fc6
Implement "Current" completion for bind.
...
When binding a key, the first row will be the current binding if the key
is already bound. This should make it easier for users to tell when they
are binding a key that is already bound, and what it is bound to.
2017-06-29 21:44:44 -04:00
Ryan Roden-Corrent
262b028ee9
Match error message in lineparser test.
2017-06-29 20:49:05 -04:00
Ryan Roden-Corrent
c007f592b3
Use more intuitive argument order in sql.delete.
2017-06-29 20:43:42 -04:00
Ryan Roden-Corrent
6ac940fa32
Fix pylint/coverage errors.
...
Ensure 100% coverage for sqlcategory and history, and fix some linter
errors
2017-06-27 12:33:51 -04:00
Ryan Roden-Corrent
f06880c6e2
Fix history completion delete function.
...
In order to update SqlQueryModel's rowCount after re-running the query,
we must call setQuery again.
2017-06-27 08:42:10 -04:00
Ryan Roden-Corrent
62a849c2db
Fix bugs introduced in test_models
2017-06-26 12:41:48 -04:00
Ryan Roden-Corrent
46161c3af0
Refactor delete_cur_item.
...
Taking the completion widget as an argument was overly complex.
The process now looks like:
1. CompletionView gets deletion request
2. CompletionView passes selected index to CompletionModel
3. CompletionModel passes the row data to the owning category
4. The category runs its custom completion function.
This also fixes a bug. With the switch to the hybrid (list/sql)
completion model, the view was no longer updating when items were
deleted. This fixes that by ensuring the correct signals are emitted.
The SQL model must be refreshed by running the query. We could try using
a SqlTableModel so we can call removeRows instead.
The test for deleting a url fails because qmodeltester claims the length
of the query model is still 3.
2017-06-26 08:57:36 -04:00
Ryan Roden-Corrent
866f4653c7
Fix spelling existant -> existent.
2017-06-25 22:14:38 -04:00
Ryan Roden-Corrent
0f585eda4f
Bring history.py back to 100% coverage.
...
The code of debug_dump_history was tweaked to handle a possible
OSException that can be thrown by open, which I noticed while trying to
test it.
2017-06-20 21:41:43 -04:00
Florian Bruhin
cb5cd1a910
Remove old test_commands.py
2017-06-20 15:20:32 +02:00
Florian Bruhin
994e8c692f
Merge different FakeTabbedBrowser objects
2017-06-20 15:19:53 +02:00
Florian Bruhin
750ef834dc
Make PyOpenGL a required dependency
...
Looks like the "black screen" issue isn't the only thing going wrong, some
people even report segfaults since the vendor check was added.
2017-06-20 13:05:53 +02:00
Ryan Roden-Corrent
891a6bcf14
Fix flake8 errors
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
c7a18a8b8d
Fix tests for recent sql changes
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
4e87773d89
Use a dict instead of named params for insert.
...
This allows replace to be a named parameter and allows consolidating
some duplicate code between various insert methods.
This also fixes some tests that broke because batch insert was broken.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f4f52ee204
Remove history.Entry.
...
No longer needed with sql backend. Query results build their own
namedtuple from the returned columns, and inserting new entries is just
done with named parameters.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
1fe1813431
Fix pylint errors.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
679e001a48
Separate sqlcategory title from table name.
...
Also fix a number of sql/completion tests that were failing.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
fa39b82b3c
Backup old history file after import.
...
Instead of removing it, move it to history.bak.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a6a9ad72f9
Fix test_history_interface.
...
This was still using a history dict instead of SQL history.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
22b7b21d5a
Use named placeholders for sql queries.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
3a4ef09f58
More sql code review fixes
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
6fc61d12fc
Assorted small fixes for sql code review.
2017-06-19 07:44:11 -04:00
Florian Bruhin
57d96a4512
Add a CompletionHistory instead of HistoryVisits table
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
309b6ba32c
Move _import_history to history.py.
...
Also adjusts the history import test to operate at a higher level and
ensure the old text file is removed (or isn't, in the case of an error).
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
478a719f77
Use a prepared query for historyContains.
...
This is called often, hopefully a prepared query will speed it up.
This also modifies Query.run to return self for easier chaining, so you
can use `query.run.value()` instead of `query.run` ; query.value()`.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
565ba23f8c
Don't instantiate completion models nedlessly.
...
For real this time. A mistake on the last commit like this meant models
were still spuriously instantiated.
Now that the completion model is reused, the layoutChanged signal needs
to be forwarded through, otherwise the view will not update.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a01c76db54
Remove 'group by' from url completion query.
...
This seemed to have a significant performance impact. Removing it means
that instead of just seeing the most recent atime for a given url, you
will see multiple entries.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
c297f047d2
Don't regenerate completion model needlessly.
...
If the completion model would stay the same, just keep it and update the
filter pattern rather than instantiating a new model each time the
pattern changes.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
2cd02be7b1
Remove CompletionModel.columns_to_filter.
...
Instead set this on inidividual categories, as that is where it actually
gets used. This makes it easier for SqlCompletionCategory to reuse a
prepared query (as it gets the filter field names in its constructor).
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
8fb6f45bec
Don't set pattern in SqlCategory constructor.
...
This will be called by the Completer after construction anyways, this
was a duplicate call that could be expensive.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
cf89ffa971
Fix pylint/flake8 errors
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
2c501f7fb7
Fix url completion benchmark.
...
Still had old code from pre-SQL era.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
39b561a182
Fix BaseLineParser::test_double_open.
...
Don't tie the test to a particular error message. Ths failed because a
typo was fixed (AppendLineParser -> LineParser).
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
e67da51662
Use prepared SQL queries.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
20000088de
Add debug-dump-history and fix sql history tests.
...
Trying to read from the sql database from another process was flaky.
This adds a debug-dump-history command which is used by the history BDD
tests to validate the history contents.
It outputs history in the old pre-SQL text format, so it might be
useful for those who want to manipulate their history as text.
2017-06-19 07:44:11 -04:00