Skip to content

[FR] Make tests for sites.py #80

@DiFronzo

Description

@DiFronzo

Is your feature request related to a problem? Please describe.
There are currently no automated tests for sites.py, making it difficult to ensure that the SiteManager class and related site initialization logic work as intended and to catch regressions during development.

Describe 1~3 use cases of the purposed feature

  • Verify that the SiteManager class can correctly resolve pages, handle interwiki prefixes, and manage multiple site instances.
  • Ensure that the init_sites function properly initializes the home site and other sites based on configuration, and that database connections are established as expected.
  • Confirm that error handling for missing pages, invalid prefixes, and database issues works as intended and logs appropriate messages.

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 sites.py are exercised.
  • Adding only integration tests, which may not catch issues specific to the site management and initialization logic.

Additional context
Unit tests for sites.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 SiteManager class, site resolution, and initialization functions.

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