From 6314827e91c13ef71dbc24cbe85e75ee28fdc48a Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:39:56 -0700 Subject: [PATCH] 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. --- tests/test_metadata_service_artist_image.py | 3 +++ tests/test_metadata_service_musicmap.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tests/test_metadata_service_artist_image.py b/tests/test_metadata_service_artist_image.py index c33be2b0..2ad20ed6 100644 --- a/tests/test_metadata_service_artist_image.py +++ b/tests/test_metadata_service_artist_image.py @@ -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 diff --git a/tests/test_metadata_service_musicmap.py b/tests/test_metadata_service_musicmap.py index 4f0db0f6..c5ccbbda 100644 --- a/tests/test_metadata_service_musicmap.py +++ b/tests/test_metadata_service_musicmap.py @@ -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