-
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 revision.py, making it difficult to ensure that the Revision class and its methods work as intended and to catch regressions during development.
Describe 1~3 use cases of the purposed feature
- Verify that the
Revisionclass can be instantiated with various arguments and that its properties (such asbytes,words,new,redirect, andparentredirect) return expected values. - Ensure that methods like
te_text,te_parenttext,get_link,get_parent_link, andadd_point_deductionbehave correctly under different scenarios, including edge cases like missing parent revisions or malformed text. - Confirm that error handling and logging for word count anomalies and unknown arguments works as intended.
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
revision.pyare exercised. - Adding only integration tests, which may not catch issues specific to the revision logic and its interactions with articles and sites.
Additional context
Unit tests for revision.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 Revision class and its methods.