Skip to content

[FR] Make tests for user.py #82

@DiFronzo

Description

@DiFronzo

Is your feature request related to a problem? Please describe.
There are currently no automated tests for user.py, making it difficult to ensure that the User 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 User class can correctly add, update, and remove articles and revisions, and that user contributions are accurately tracked and filtered.
  • Ensure that methods for fetching, saving, and backfilling contributions from both the wiki API and the database behave as expected, including handling edge cases like deleted or moved revisions.
  • Confirm that result formatting, statistics counting, and analysis methods produce the correct output for various user activity scenarios.

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 user.py are exercised.
  • Adding only integration tests, which may not catch issues specific to the user logic and its interactions with articles, revisions, and contributions.

Additional context
Unit tests for user.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 User 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