Skip to content

[FR] Make tests for revision.py #77

@DiFronzo

Description

@DiFronzo

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions