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
Corentin Jule
3426dd06f6
Add some docstrings
2015-12-04 21:57:34 +01:00
Corentin Jule
95b200ead9
Pylint code cleanup
2015-12-04 01:52:00 +01:00
Corentin Jule
8dd0249af9
Code cleanup - Pep8
2015-12-03 22:00:39 +01:00
Corentin Jule
2d850f7106
Add tests for first functions of adblock.py
2015-12-03 21:12:51 +01:00
Florian Bruhin
eff0e4c7cc
pylint: Enable useless-suppression globally.
...
We deactivate it locally where needed, i.e. where we are sure it's some
platform-specific thing.
2015-12-01 23:01:09 +01:00
Florian Bruhin
cf54fa1ef1
pylint: Remove some now useless suppressions.
2015-12-01 23:00:48 +01:00
Florian Bruhin
b3515f5e82
pylint: Remove import-error disabling from tests.
2015-12-01 22:47:10 +01:00
Florian Bruhin
5817b47f75
Revert "Use fully qualified imports in tests."
...
Seems like this also breaks frozen tests...
This reverts commit c7fdcc92b8
.
2015-12-01 22:45:59 +01:00
Florian Bruhin
109984c96e
pylint: Check attr-defined-outside-init for tests.
2015-12-01 22:41:16 +01:00
Florian Bruhin
803398c49b
Use some more fixtures for older tests.
2015-12-01 22:40:58 +01:00
Florian Bruhin
c7fdcc92b8
Use fully qualified imports in tests.
...
This is cleaner even if pylint can't handle it.
2015-12-01 22:03:59 +01:00
Florian Bruhin
150a83d8f4
pylint: Remove unneeded supressions.
2015-12-01 22:03:58 +01:00
Tomasz Kramkowski
c575435782
misc/editor: Fix tempfile deleted on error / editor crash
...
This patch attempts to fix an issue where an error occuring in
misc/guiprocess or the editor process crashing would delete the
temporary file thus making it impossible to recover changes not commited
to the form field from the editor.
2015-12-01 20:22:05 +00:00
Florian Bruhin
f7a13fa1f9
Rename LineParserWrapper to LineParserMixin.
...
This makes pylint shut up as it realizes it is, in fact, a mixin.
2015-11-30 07:11:35 +01:00
Florian Bruhin
288bf1524e
Fix some unidiomatic comparisons.
2015-11-30 07:10:21 +01:00
Florian Bruhin
d286f637d6
tests: Set basedir to None, not ''.
...
Turns out setting basedir='' creates cache/ in cwd.
2015-11-29 01:23:28 +01:00
Florian Bruhin
6a46aea934
Fix tests for basedir logging.
...
f5febc4
broke various tests which called standarddir.init() without a valid
basedir.
2015-11-29 00:35:18 +01:00
Florian Bruhin
c236e70920
Merge branch 'log-javascript-console' of https://github.com/flv0/qutebrowser into flv0-log-javascript-console
2015-11-28 21:12:25 +01:00
Florian Bruhin
83b94a8be5
Fix session tests.
...
FakeMainWindow needs to be a QObject now as we use sip.isdeleted since
8cf6ace0e7
and that raises a TypeError on
non-QObject's.
2015-11-28 20:41:42 +01:00
Patric Schmitz
913aa209c6
remove BadMappingSubclass and rename MappingSubclass
2015-11-28 20:17:31 +01:00
Patric Schmitz
dbc6f63fc0
remove whitespace
2015-11-28 18:57:41 +01:00
Patric Schmitz
03ba38578e
set valid_values after __init__ consistently, move type validation out of class into pytest
2015-11-28 18:29:51 +01:00
Patric Schmitz
c14b52f916
initialize valid_values separately, not using base class __init__ parameter
2015-11-28 18:29:51 +01:00
Patric Schmitz
6f65397dfe
always set valid_values in __init__ instead of class scope variable
2015-11-28 18:29:51 +01:00
Florian Bruhin
962ba36cda
Skip qtutils.savefile_open tests without DISPLAY.
...
I don't get why, but for some reason they cause a segfault from time to time...
So let's just skip them.
2015-11-27 19:11:37 +01:00
Florian Bruhin
be4cf19bb1
tests: Improve some parametrized test IDs.
2015-11-27 16:25:25 +01:00
Florian Bruhin
f3c378858b
tests: Remove duplicate test_split testcases.
2015-11-27 16:22:48 +01:00
Florian Bruhin
951c2e8eb6
Fix qflags_key comparison.
2015-11-25 18:54:03 +01:00
Florian Bruhin
67f726c9d4
tests: Add another BOM test for javascript_escape.
2015-11-25 18:47:16 +01:00
Florian Bruhin
73e9fd1118
Handle BOM (\ufeff) for webelem.javascript_escape.
2015-11-25 18:14:52 +01:00
Florian Bruhin
24a71e5c2e
Fix webelem.javascript_escape with U+2028/U+2029.
2015-11-25 10:32:22 +01:00
Florian Bruhin
14f4689998
tests: Fix TestInitLog.
...
This worked before b0d4ebe
because --debug was given and the
"args.loglevel.upper()" part was never executed.
However, loglevel is expected as a string, not as an int.
2015-11-23 21:50:48 +01:00
Florian Bruhin
196d1e95be
tests: Skip test_normal_connection IPC test on OS X.
...
Seems like it hangs there sometimes.
2015-11-23 20:33:11 +01:00
Florian Bruhin
16e1a65448
Merge branch 'download-page' of https://github.com/Kingdread/qutebrowser into Kingdread-download-page
2015-11-23 13:16:16 +01:00
Daniel Schadt
c12011c84d
Style fixes
2015-11-21 00:10:49 +01:00
Florian Bruhin
1ec03462c8
Add a utils.parse_keystring.
2015-11-20 07:06:16 +01:00
Daniel Schadt
3438a45b19
Merge branch 'master' into download-page
2015-11-18 19:27:26 +01:00
Florian Bruhin
dd2ec30b97
Revert "Use parametrization for TestKeyToString:test_all."
...
This reverts commit aa1ea9b063
.
I changed my mind on this, generating >400 tests for this is stupid.
2015-11-18 18:15:21 +01:00
Florian Bruhin
eeab4d41ba
Make it possible to pass a count via command name.
...
This is only used for tests so far and not intended for general usage (and thus
undocumented).
2015-11-15 19:55:01 +01:00
Florian Bruhin
9607fae935
Skip check_coverage.py with --lf.
2015-11-13 22:43:12 +01:00
Florian Bruhin
b61462ccb8
Fix the style fixes.
2015-11-13 22:41:37 +01:00
Florian Bruhin
1da7996c3b
Style fixes.
2015-11-13 22:27:41 +01:00
Florian Bruhin
40c7990d3a
tests: Skip ipc TestSendToRunningInstance on OS X.
...
This did hang often on OS X, and I don't have the time to properly debug this.
See #1045 .
2015-11-12 22:17:37 +01:00
Florian Bruhin
3680f01576
Switch to pytest 2.8.
...
Closes #1077 .
There were two issues:
- Paths for coverage.py suddenly were absolute instead of relative, so we strip
the common base part if that happens.
/home/florian/proj/qutebrowser/git/qutebrowser/browser/cookies.py has 100%
coverage but is not in perfect_files!
/home/florian/proj/qutebrowser/git/qutebrowser/browser/http.py has 100%
coverage but is not in perfect_files!
[...]
- There was an io.UnsupportedOperationError in test_check_coverage.py because
of pytest-faulthandler, so we just don't load that in the subprocess.
2015-11-11 20:57:47 +01:00
Florian Bruhin
416cfaf002
tests: Switch from pytest-capturelog to catchlog.
2015-11-11 19:57:03 +01:00
Florian Bruhin
7cddd52b2d
Merge branch 'download-page' of https://github.com/Kingdread/qutebrowser into Kingdread-download-page
2015-11-10 22:39:07 +01:00
Florian Bruhin
250f0e7410
Merge branch 'test-browser-cache-more' of https://github.com/lamarpavel/qutebrowser into lamarpavel-test-browser-cache-more
2015-11-10 18:57:28 +01:00
Florian Bruhin
e1c6cd6c6d
tests: Skip test_file for PyQIODevice on OS X.
...
Those seem to cause a hang on Travis on OS X sometimes.
2015-11-10 08:55:31 +01:00
Lamar Pavel
a2a1b77857
Undo unnecessary change
2015-11-10 03:45:38 +01:00
Lamar Pavel
fe8ddd79c0
Use config_stub.set instead of emitting sginal manually
2015-11-10 03:43:02 +01:00
Daniel
a1bc020fec
mhtml: Sanitize default filename suggestion
2015-11-09 17:01:08 +01:00
Daniel
5601c8e7c1
mhtml: Skip test if cssutils is unavailable
...
Instead of failing the test (assert cssutils is not None)
2015-11-09 17:01:08 +01:00
Daniel
ae8a9b8798
Handle non-ASCII in headers/url better
2015-11-09 17:01:08 +01:00
Daniel
f2f9529af7
Remove sys import in test_mhtml
2015-11-09 17:01:08 +01:00
Daniel
ed8a6a4c7b
Update to cssutils 1.0.1
...
This fixes cssutils on Python 3.5 (yay!).
2015-11-09 17:01:08 +01:00
Daniel
3a2bb2d348
Add cssutils to README and utils/version.py
2015-11-09 17:01:08 +01:00
Daniel
dd8ff860f4
Fix lint
2015-11-09 16:59:16 +01:00
Daniel
b027e6af1b
Mark cssutils tests as xfail on Python >= 3.5
2015-11-09 16:59:16 +01:00
Daniel
dab0db30a5
Remove tests for remove_file from test_mhtml.py
2015-11-09 16:59:16 +01:00
Daniel
957d68c477
Revert "Remove cssutils from mhtml.py"
...
This reverts commit 22a0f0952704d284846ab2572790d99a85515c57.
2015-11-09 16:59:16 +01:00
Daniel
ce1a99cc7c
Remove cssutils from mhtml.py
2015-11-09 16:59:16 +01:00
Daniel
420c087373
use cssutils
2015-11-09 16:59:16 +01:00
Daniel
749b1c02cc
Style changes for mhtml and test_mhtml
2015-11-09 16:59:16 +01:00
Daniel
b05a0d191d
Fix module path in test_mhtml
...
Also fix docstring for _get_css_imports
2015-11-09 16:59:16 +01:00
Daniel
2eeace1c2c
Move misc.mhtml to browser.mhtml
2015-11-09 16:59:16 +01:00
Daniel
a092ef1fe6
String quote style changes
...
"" for user facing strings
'' for internal strings
except when quotes appear inside a string, to avoid escaping them
2015-11-09 16:59:16 +01:00
Daniel
9bf9124324
Fix mhtml tests, add test for _NoCloseBytesIO
2015-11-09 16:59:16 +01:00
Daniel
bf90c8c06b
Add tests for mhtml
...
This also makes the output of MHTMLWriter deterministic, by
1) Setting the boundary at object creation, allowing uuid.uuid4 to be
monkey patched
2) Outputting the files in sorted order (sorted by location), as python
dicts are unordered by default.
2015-11-09 16:59:16 +01:00
Lamar Pavel
cbb9fd203a
Fix test of existing metadata files
...
In test_cache_existing_metadata_file() we are now getting the correct
path to the metadata files, thus making the test useful. This was the
last missing test, the cache is now 100% covered (issue#999).
2015-11-05 23:08:38 +01:00
Florian Bruhin
6c20190473
Merge branch 'master' of https://github.com/forkbong/qutebrowser into forkbong-master
2015-11-04 07:12:32 +01:00
Florian Bruhin
702842c977
configtypes: Handle max. recursion depth for Regex.
2015-11-04 07:02:23 +01:00
Panagiotis Ktistakis
dc06787f83
Make key config migration for clearing downloads.
2015-11-04 01:01:27 +02:00
Florian Bruhin
bb4152d705
Add xfail test for vulture bug.
2015-11-02 18:25:16 +01:00
Florian Bruhin
1563693037
tests: Ignore "QIODevice::write: device not open".
2015-11-02 08:15:22 +01:00
Florian Bruhin
0d67cff5cb
Merge branch 'bdd'
...
Conflicts:
tests/test_conftest.py
tox.ini
2015-11-02 06:36:30 +01:00
Florian Bruhin
4451165a27
Change IPC warnings to debug.
...
This seems to show up on Ubuntu Trusty (with older Qt) as well...
2015-11-01 23:11:42 +01:00
Florian Bruhin
867f509bcc
tests: Ignore QDisabledNetworkReply warning.
...
I guess they are displayed now during teardown with the changes in pytest-qt.
2015-11-01 18:04:09 +01:00
Florian Bruhin
3a522fb551
tests: Remove .close() workaround.
...
This is not needed anymore with pytest-qt 1.9.0.
2015-11-01 17:41:40 +01:00
Lamar Pavel
e86795f644
Add another test for pyqtslot on_config_changed
...
There are now two tests changing the config for private-browsing, covering
both True->False and False->True.
2015-11-01 14:55:03 +01:00
Lamar Pavel
70a6fe1561
Add tests triggering pyqtslot on_config_changed
...
Both settings relevant to the cache (cache-size and private-browsing) are
changed, a signal is emitted and the effect on the cache is verified.
2015-11-01 14:39:43 +01:00
Lamar Pavel
d127469d78
Add tests for fileMetaData()
...
One of those three tests is not complete as I couldn't yet find a way
to predict the path and name of cached files when using tmpdir.
2015-10-31 21:56:15 +01:00
Lamar Pavel
b94f7c7681
Add test for metaData() with cache deactivated
2015-10-31 18:49:58 +01:00
Lamar Pavel
404da750c6
Fix insertion into wrong cache
2015-10-31 18:32:14 +01:00
Lamar Pavel
571d7a680b
Fix all other tests that weren't using DiskCache
...
So yeah, this explains a lot of the missing paths reported by the
coverage analysis.
2015-10-31 17:09:00 +01:00
Lamar Pavel
35762955cf
Fix test_cache_remove_data
...
The test was not using qutebrowsers DiskCache class at all but Qts
QNetworkDiskCache. As a result the code paths of DiskCache.remove()
were never visited.
2015-10-31 16:57:00 +01:00
Lamar Pavel
3c2bc670ff
Add test for alternate path of DiskCache.clear()
2015-10-31 16:33:01 +01:00
Lamar Pavel
e1446c3448
Add another test for deactivated cache
...
This one is testing the missing path in updateMetaData for a not activated
cache.
2015-10-31 16:28:17 +01:00
Lamar Pavel
39e37b043e
Add more tests for deactivated cache
...
Getting closer to 100% completion, add tests for missing paths of
DiskCache.insert and DiskCache.cacheSize().
2015-10-31 16:13:29 +01:00
Florian Bruhin
468b2c4ade
Merge branch 'test-browser-cache' of https://github.com/lamarpavel/qutebrowser into lamarpavel-test-browser-cache
2015-10-30 18:54:24 +01:00
Lamar Pavel
27ec9e1c43
Fix typo
2015-10-30 02:46:43 +01:00
Lamar Pavel
b5af1c8730
Add three tests querying and removing data
...
Two of these are testing return values of a deactivated cache and the
third is trying to query data that was never inserted into an active
cache.
2015-10-30 02:41:17 +01:00
Lamar Pavel
b3fa19eb96
Add sanity test involving almost everything
2015-10-30 02:03:34 +01:00
Lamar Pavel
05994ad90e
Add theshold to cache-size test
...
The strict test condition before was violated by Qt internals which
seem to violate documented guarantees but are not part of qutebrowsers
code and thus can only be tested to a certain extent.
2015-10-30 01:22:16 +01:00
Lamar Pavel
9a8032fa91
Fix pylint errors (upper case variable names)
2015-10-29 03:13:25 +01:00
Lamar Pavel
a6526a1be2
Add tests to update and verify meta data of cache entries
2015-10-29 02:57:16 +01:00
Lamar Pavel
2cab750a54
Add test for DiskCache.remove()
2015-10-29 02:37:32 +01:00
Lamar Pavel
e4c79a68d1
re-write tests to fill the cache
...
Previously the tests were not adding any data to the cache, making the
tests for a cache size other than 0 meaningless.
The new tests create cache entries and fill them with some data that
can be tested against.
2015-10-29 02:28:57 +01:00
Florian Bruhin
6f07eb562f
Revert "Don't use faulthandler plugin for check_coverage."
...
This reverts commit 497fba5667
.
2015-10-28 08:22:41 +01:00
Florian Bruhin
497fba5667
Don't use faulthandler plugin for check_coverage.
2015-10-28 07:45:34 +01:00
Florian Bruhin
c85aa40073
Skip connected_socket IPC tests on OS X.
...
Fixes #1045 - I don't have the time to look into this :-/
2015-10-26 09:04:41 +01:00
Florian Bruhin
883febe243
Return a QColor for qtutils.interpolate_color.
...
This broke the tests for older PyQt versions because the test had a
test_utils.Color(test_utils.Color(...)) object (double-wrapped), and the
comparisons failed there for some reason.
2015-10-26 06:45:36 +01:00
Florian Bruhin
bb5e5137cd
configtypes: Allow completions for String.
2015-10-25 21:18:06 +01:00
Florian Bruhin
f614e5b98a
Add none value for colors -> tabs.indicator.system.
2015-10-24 16:01:32 +02:00
Florian Bruhin
cdb9c0998f
Add a comment for close() call.
2015-10-24 08:07:43 +02:00
Daniel
9722d4ba03
test_tabwidget: Make config_stub explicit
...
... also call TabWidget.close() at the end of the test.
2015-10-24 01:32:01 +02:00