-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
Is your feature request related to a problem? Please describe.
There are currently no automated tests for filters.py, making it difficult to ensure that the various filter classes and their methods work as intended and to catch regressions during development.
Describe 1~3 use cases of the purposed feature
- Verify that each filter class (such as
CatFilter,TemplateFilter,ByteFilter,NewPageFilter, etc.) correctly filters articles according to the intended logic and configuration. - Ensure that error handling, such as for missing categories, unrecognized sites, or malformed templates, logs appropriate warnings and does not cause unexpected failures.
- Confirm that edge cases, such as articles with no categories, circular category references, or filters with wildcard or language-specific behavior, are handled gracefully.
Describe alternatives you've considered
- Relying on manual testing or indirect coverage through higher-level tests, but this does not guarantee that all code paths in
filters.pyare exercised. - Adding only integration tests, which may not catch issues specific to the filter logic and its interactions with articles, categories, and sites.
Additional context
Unit tests for filters.py will help maintain code quality and reliability. Tests could be implemented using pytest or unittest, and should cover both typical and edge-case usage of the filter classes and their methods.