Commit Graph

338 Commits

Author SHA1 Message Date
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
150a83d8f4 pylint: Remove unneeded supressions. 2015-12-01 22:03:58 +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
Daniel Schadt
c12011c84d Style fixes 2015-11-21 00:10:49 +01:00
Daniel Schadt
3438a45b19 Merge branch 'master' into download-page 2015-11-18 19:27:26 +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
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
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
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
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
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
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
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
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
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
Lamar Pavel
24887a6564 Adjust coding style based on pylint warnings 2015-10-23 01:49:00 +02:00
Lamar Pavel
4a8dec5eb8 Code style; complete first batch of tests. 2015-10-21 22:31:46 +02:00
Lamar Pavel
82c608038d Coding style 2015-10-21 22:31:46 +02:00
Lamar Pavel
0b78fb65c9 Test if cleared cache is actually empty 2015-10-21 22:31:46 +02:00
Lamar Pavel
aa62a547d5 Use tmpdir fixture instead of "/foo/bar" 2015-10-21 22:31:46 +02:00
Lamar Pavel
a99d3f6525 Add first 3 tests for browser.cache
Note: test_cache_deactivated_private_browsing is currently failing
2015-10-21 22:31:46 +02:00
Florian Bruhin
c8346a11fc Merge branch 'jinja' of https://github.com/meles5/qutebrowser into meles5-jinja 2015-10-17 19:04:36 +02:00
meles5
2398762e85 Fix tests 2015-10-17 18:29:13 +02:00
Florian Bruhin
24dc166e1f tests: Use extend=True for qt_log_ignore marks.
This should finally resolve the warning flakiness on OS X.
2015-10-16 06:24:29 +02:00
Florian Bruhin
cabbe406e3 tests: Fix ignoring of "load glyph failed" message.
The mark seems to be swallowed somehow when it's after @hypothesis.given.

See https://github.com/DRMacIver/hypothesis/issues/189
2015-10-05 08:11:26 +02:00
Florian Bruhin
11961db72c Add maxlen argument to ErrorNetworkReply.readData.
This was missing before, causing a (hidden) exception with Python < 3.5, and
this with 3.5:

    TypeError: readData() takes 1 positional argument but 2 were given

    During handling of the above exception, another exception occurred:

    SystemError: PyEval_EvalFrameEx returned a result with an error set

Fixes #969.
2015-09-29 08:41:20 +02:00
Florian Bruhin
4854ca42fd Fix tests without DISPLAY. 2015-09-28 21:50:55 +02:00
Florian Bruhin
0de1e40f20 Add filescheme test for names with special chars.
Inspired by https://github.com/QupZilla/qupzilla/pull/1711
2015-09-24 06:45:33 +02:00
Florian Bruhin
57242e925c Fix names of constants. 2015-09-16 23:00:02 +02:00
Florian Bruhin
d5baed5e83 Merge branch 'cookies_tests' of https://github.com/acogneau/qutebrowser into acogneau-cookies_tests 2015-09-16 22:58:28 +02:00
Florian Bruhin
88167ce4ce Shorten test IDs. 2015-09-16 20:25:02 +02:00
Alexander Cogneau
ec11a61ed8 Fix failing tests 2015-09-13 23:08:31 +02:00
Alexander Cogneau
c08beda1aa Code cleanup 2015-09-12 22:11:14 +02:00
Alexander Cogneau
851bf4cd31 Fix pylint 2015-09-06 16:13:41 +02:00
Alexander Cogneau
6541a360b1 Final cooikies tests 2015-09-06 00:24:38 +02:00
Alexander Cogneau
d36c701b07 Fixed comments 2015-09-04 11:44:59 +02:00
Alexander Cogneau
418328e61b Cookie tests done 2015-09-03 18:17:39 +02:00
Alexander Cogneau
96e3a0b1f1 first cookie tests 2015-09-03 17:24:01 +02:00
Florian Bruhin
8ea91b5bbc Fix cookiejar_and_cache move. 2015-08-31 08:00:21 +02:00
Florian Bruhin
79c1867e6c Don't save cookies when starting in private mode.
Whoops... :(

Fixes #903.
2015-08-30 23:17:48 +02:00
Florian Bruhin
6df00f8266 Move cookiejar_and_cache fixture to conftest.py. 2015-08-30 23:11:23 +02:00
Florian Bruhin
6d8854bc07 Simplify usage of tabhistory.TabHistoryItem. 2015-08-23 18:16:19 +02:00
Florian Bruhin
543053c8f5 test_signalfilter: Remove unused fixture. 2015-08-20 07:14:32 +02:00
Florian Bruhin
2c5269acd6 Reorganize tests directory. 2015-08-18 20:19:02 +02:00