Commit Graph

567 Commits

Author SHA1 Message Date
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