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
Revision class can be instantiated with various arguments and that its properties (such as bytes, words, new, redirect, and parentredirect) return expected values.
- Ensure that methods like
te_text, te_parenttext, get_link, get_parent_link, and add_point_deduction behave 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.py are 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.
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 theRevisionclass and its methods work as intended and to catch regressions during development.Describe 1~3 use cases of the purposed feature
Revisionclass can be instantiated with various arguments and that its properties (such asbytes,words,new,redirect, andparentredirect) return expected values.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.Describe alternatives you've considered
revision.pyare exercised.Additional context
Unit tests for
revision.pywill help maintain code quality and reliability. Tests could be implemented using pytest or unittest, and should cover both typical and edge-case usage of theRevisionclass and its methods.