Commit graph

116 commits

Author SHA1 Message Date
Tobias Gruetzmacher
db2ff4c3c1 Test image "resizing" 2020-01-04 15:59:49 +01:00
Tobias Gruetzmacher
5a92505606 Fix & test query string parsing 2019-12-31 00:43:46 +01:00
Tobias Gruetzmacher
d0bc0572c2 Add a test to ckeck that renamed comics point to existing comics 2019-12-29 20:50:56 +01:00
Tobias Gruetzmacher
74bb9e76b6 Python 2 fix - yes, really 2019-12-27 18:38:09 +01:00
Tobias Gruetzmacher
adb3db3d22 Add some tests for the update check 2019-12-05 22:23:48 +01:00
Tobias Gruetzmacher
ad8a46f67a Fix urlmatch test 2019-12-05 00:58:31 +01:00
Tobias Gruetzmacher
18f8e093a7 Tests: Keep comics of the same module in the same process
This allows our host-based throttling to be effective and keeps
cross-process locks to a minimum.
2019-12-04 00:28:27 +01:00
Tobias Gruetzmacher
fcebd63e66 Speed up tests by mocking time.sleep() 2019-12-03 23:52:14 +01:00
Tobias Gruetzmacher
4d2fac1a9c Make it easier to write tests for comic modules
This also adds a simple test for the "turnoff" module to demonstrate
these features.
2019-12-01 22:36:49 +01:00
Tobias Gruetzmacher
00d0201c5f Fix a bunch of flake8 issues 2019-11-04 00:16:25 +01:00
Tobias Gruetzmacher
e24c0ae557 Simplify voting code
Not sure if I keep this feature, but at least I can now see if anybody
is still using it...
2019-11-03 21:04:34 +01:00
Tobias Gruetzmacher
d243017aff Add test for recently added helper 2019-10-28 19:17:57 +01:00
Mikkel Høgh
0dea216851 Fix missing returns in RSS parsing (#137)
Also added a very basic test for feed parsing.
2019-10-28 16:48:21 +01:00
Gervásio Júnior
6c8814fe40 Fix multiple imgs for json flag & ZenPencils bouncer (#133)
When using the JSON output flag, if the page has more than one image,
dictionary indexing cannot be used as list.

For the ZenPencils comic, the bouncer is missing, saving the page url
as the root url.
2019-06-19 07:09:33 +02:00
Tobias Gruetzmacher
6ba1e49bfd Kenneth Reitz’s Code Style™
See http://docs.python-requests.org/en/master/dev/contributing/#kenneth-reitz-s-code-style

Effectively, this removes "visual" indents.
2018-06-29 19:26:17 +02:00
Tobias Gruetzmacher
d88f6aeee3 Replace online tests with mocks.
We want to test our code, not the comic modules.
2017-10-15 14:54:44 +02:00
Tobias Gruetzmacher
f1b83748ed When testing the command line, call main method.
Previously, we were spawning the main binary in a subprocess, which is
fragile and interacts poorly with some testing frameworks...
2017-10-15 14:54:44 +02:00
Tobias Gruetzmacher
11ee049b4d Move checking of modules into its own directory. 2017-10-13 00:00:37 +02:00
Tobias Gruetzmacher
6de5b79fb8 Switch test to a comic without robots.txt block. 2017-08-11 00:12:07 +02:00
Tobias Gruetzmacher
8b90aa5cfb Some minor style fixes. 2017-05-15 00:54:02 +02:00
Tobias Gruetzmacher
9a6a310b76 Fixup copyright years. 2016-10-29 00:21:41 +02:00
Tobias Gruetzmacher
fb37f946e0 Speed up comic module tests.
This fakes an If-Modified-Since header, so most web servers don't need
to send comic images at all. This should also reduce the amount of data
that needs to be fetched for comic module tests.
2016-08-01 00:44:34 +02:00
Tobias Gruetzmacher
ca1c32cf09 Use a more reliable comic for tests. 2016-05-21 16:16:02 +02:00
Tobias Gruetzmacher
51008a975b Refactor: Introduce generator methods for scrapers
This allows one comic module class to generate multiple scrapers. This
change is to support a more dynamic module system as described in #42.
2016-05-21 01:29:36 +02:00
Tobias Gruetzmacher
efe1308db2 Replace home-grown Python2/3 compat. with six. 2016-05-05 23:33:48 +02:00
Tobias Gruetzmacher
00fb51341a "Better" selection of default test comics. 2016-04-26 08:03:34 +02:00
Tobias Gruetzmacher
4204f5f1e4 Send "If-Modified-Since" header for images. 2016-04-19 00:36:50 +02:00
Tobias Gruetzmacher
7708c678a6 Move test parametrization into its own file. 2016-04-16 12:01:43 +02:00
Tobias Gruetzmacher
7c3a87970b Fix test naming. 2016-04-16 11:54:29 +02:00
Tobias Gruetzmacher
ee99c087d7 Remove prevUrlMatchesStripUrl.
It was only used for one test.
2016-04-16 01:14:26 +02:00
Tobias Gruetzmacher
060281e5ff Use concrete scraper objects everywhere.
This is a first step for #42. Since most access to the scraper classes
is through instances, modules can now dynamically override url and name
(name is now a property).
2016-04-13 22:17:30 +02:00
Tobias Gruetzmacher
1aebdce5d2 Fix test :) 2016-04-13 01:32:15 +02:00
Tobias Gruetzmacher
dda920f353 Use py.test's tmpdir fixture. 2016-03-28 16:29:57 +02:00
Tobias Gruetzmacher
36cc4e32f4 Allow selection of comics to test via environment.
If you need to run test cases for your new comic module, you can call
py.test like this:

    TESTCOMICS="ComicFury/" py.test -v tests/test_comics.py
2016-03-13 13:03:41 +01:00
Tobias Gruetzmacher
2ca74d6e6b Convert all tests to py.test & cleanups. 2016-03-07 01:08:57 +01:00
Tobias Gruetzmacher
41c03af3d9 Don't use SexyLosers for tests.
It's currently broken.
2016-03-04 00:28:05 +01:00
Tobias Gruetzmacher
f0e61a614f Refactor comic module test.
All those create-classes-on-the-fly games make my head hurt ;)
2015-07-17 23:33:25 +02:00
Tobias Gruetzmacher
d88b97573d Stable test order. 2015-07-16 01:32:24 +02:00
Tobias Gruetzmacher
ea4472cd7c Test with comic that is still fetchable... 2015-07-16 00:53:10 +02:00
Tobias Gruetzmacher
ff21df596b Remove descriptions and genres (closes #9).
Maintaining the descriptions creates quite a bit of overhead (finding
them, copying them, checking if they are still correct) for a minimal
user benefit.

PS: Viewing this diff should be easier in a difftool that shows changes
in a line, for example kdiff3.
2015-04-20 20:29:09 +02:00
Tobias Gruetzmacher
89ada9de7e Switch tests to a unique comic name. 2015-04-18 12:34:33 +02:00
Bastian Kleineidam
4d63920434 Updated copyright. 2014-01-05 16:50:57 +01:00
Bastian Kleineidam
365fd17802 Fix dosage tests 2014-01-05 14:26:46 +01:00
Bastian Kleineidam
1f38895681 Ensure only on instance of dosage is running to prevent accedental DoS on sites with multiple comics. 2014-01-05 10:36:22 +01:00
Bastian Kleineidam
ca23f7a4d7 Consider text files in result checks. 2013-12-05 18:29:15 +01:00
Bastian Kleineidam
0e780e9741 Fix random test case. 2013-11-08 18:40:55 +01:00
Bastian Kleineidam
e7436d7d79 Fix for python 3.3 2013-11-07 21:22:38 +01:00
Bastian Kleineidam
75bbf10d78 Initialize tmpdir. 2013-06-28 21:34:01 +02:00
Bastian Kleineidam
27c90f07a5 Fix tests with newer pytest versions. 2013-06-28 21:25:55 +02:00
Bastian Kleineidam
13963d8bfe Improve comicname error message. 2013-05-22 22:29:29 +02:00