Fix test-order-dependent failures in new metadata_service tests
The _DummyConfigManager stubs in test_metadata_service_musicmap.py and test_metadata_service_artist_image.py were missing get_active_media_server(), which the existing test_metadata_service_discography.py dummy provides. Both files install their dummy via sys.modules["config.settings"] with an "if not in sys.modules" guard, so whichever test file loads first wins. When the new files load alphabetically before discography, the limited dummy persists and later tests hit AttributeError on get_active_media_server. Adds the same get_active_media_server method to both dummies so all three test files are equivalent and test ordering no longer affects outcomes.
This commit is contained in:
parent
9eaf53630c
commit
6314827e91
2 changed files with 6 additions and 0 deletions
|
|
@ -30,6 +30,9 @@ if "config.settings" not in sys.modules:
|
|||
def get(self, key, default=None):
|
||||
return default
|
||||
|
||||
def get_active_media_server(self):
|
||||
return "primary"
|
||||
|
||||
settings_mod.config_manager = _DummyConfigManager()
|
||||
config_pkg.settings = settings_mod
|
||||
sys.modules["config"] = config_pkg
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ if "config.settings" not in sys.modules:
|
|||
def get(self, key, default=None):
|
||||
return default
|
||||
|
||||
def get_active_media_server(self):
|
||||
return "primary"
|
||||
|
||||
settings_mod.config_manager = _DummyConfigManager()
|
||||
config_pkg.settings = settings_mod
|
||||
sys.modules["config"] = config_pkg
|
||||
|
|
|
|||
Loading…
Reference in a new issue