1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 14:30:01 +00:00
Commit graph

6 commits

Author SHA1 Message Date
queue b1d187613a bencode: fix nontermination on empty or malformed input
read(1) returns b'' on EOF, which wasn't checked for in a couple cases,
which could cause empty/truncated input to enter one of the `while True`
loops without hope of exit. programming is hard.
2017-07-24 20:53:48 -06:00
Kfir Hadas c466e76471 Fix RFC822 filters + More tests (#257)
* Make rfc822 filters compatible with Windows systems.

.strftime() is relative to the system it's being run on.
UNIX has '%s' for seconds since the EPOCH, Windows doesn't (ValueError).
Solution: use .timestamp() to achieve the same result on both platforms.
This also allows us to drop the float() around it, since it returns a float.

* Start testing filters

* Add placeholders for more tests

* Make 'tests' folder a Python package

Now you can run tests with just `pytest tests`

* Update readme and travis config

* Test timesince()

* Update and organize .gitignore

Deleted: (nothing)
Added: Coverage files, .idea\

* Test filter_truthy, category_name

* Tests for backend.py

* Tests for bencode.py

* Move (empty) test_models.py to tests package

* Tests for utils.py

* Fixes for flattenDict

* Change name to `flatten_dict`
* `newkey` was assigned but never used

* Add a helper class for testing

* Show coverage on Travis

(only Travis for now...)

* Remove IDE

* Use correct assert functions

* Update README.md
2017-07-07 16:14:37 -05:00
Kfir Hadas 95a6c6c799 Amend method name to reflect actual reg URL test
Cherry-picked 3bb9517f2a61a00fd1443d94ffd11f1f34d33ee6
2017-06-08 04:05:00 +03:00
Kfir Hadas 2246f019ea Use spaces 2017-06-07 19:32:45 +03:00
Nathan Yam 64098dae49 Rename test method better 2017-06-07 18:05:32 +03:00
Nathan Yam 232af1dc38 Add basic URL routing tests 2017-06-07 18:05:32 +03:00