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.
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 theSiteManagerclass and related site initialization logic work as intended and to catch regressions during development.Describe 1~3 use cases of the purposed feature
SiteManagerclass can correctly resolve pages, handle interwiki prefixes, and manage multiple site instances.init_sitesfunction properly initializes the home site and other sites based on configuration, and that database connections are established as expected.Describe alternatives you've considered
sites.pyare exercised.Additional context
Unit tests for
sites.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 theSiteManagerclass, site resolution, and initialization functions.