mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-16 00:09:05 +00:00
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
This commit is contained in:
@@ -11,9 +11,9 @@ It's not impossible to run Nyaa on Windows, but this guide doesn't focus on that
|
||||
- Other than PEP8, try to keep your code clean and easy to understand, as well. It's only polite!
|
||||
|
||||
### Running Tests
|
||||
We have some basic tests that check if each page can render correctly. To run the tests:
|
||||
The `tests` folder contains tests for the the `nyaa` module and the webserver. To run the tests:
|
||||
- Make sure that you are in the python virtual environment.
|
||||
- Run `python -m pytest tests/` while in the repository directory.
|
||||
- Run `pytest tests` while in the repository directory.
|
||||
|
||||
### Setting up Pyenv
|
||||
pyenv eases the use of different Python versions, and as not all Linux distros offer 3.6 packages, it's right up our alley.
|
||||
|
||||
Reference in New Issue
Block a user