-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
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
SiteManagerclass can correctly resolve pages, handle interwiki prefixes, and manage multiple site instances. - Ensure that the
init_sitesfunction 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.pyare 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.