diff --git a/tests/core/test_library.py b/tests/core/test_library.py index 4a96042d..bebdd8a6 100644 --- a/tests/core/test_library.py +++ b/tests/core/test_library.py @@ -9,7 +9,7 @@ from mopidy import backend, core from mopidy.models import Image, Ref, SearchResult, Track -class CoreLibraryTest(unittest.TestCase): +class BaseCoreLibraryTest(unittest.TestCase): def setUp(self): # noqa: N802 dummy1_root = Ref.directory(uri='dummy1:directory', name='dummy1') self.backend1 = mock.Mock() @@ -38,6 +38,9 @@ class CoreLibraryTest(unittest.TestCase): self.core = core.Core(mixer=None, backends=[ self.backend1, self.backend2, self.backend3]) + +# TODO: split by method +class CoreLibraryTest(BaseCoreLibraryTest): def test_get_images_returns_empty_dict_for_no_uris(self): self.assertEqual({}, self.core.library.get_images([])) @@ -288,15 +291,15 @@ class CoreLibraryTest(unittest.TestCase): query={'any': ['foobar']}, uris=None, exact=False) -class DeprecatedCoreLibraryTest(CoreLibraryTest): +class DeprecatedFindExactCoreLibraryTest(BaseCoreLibraryTest): def setUp(self): # noqa: N802 - super(DeprecatedCoreLibraryTest, self).setUp() + super(DeprecatedFindExactCoreLibraryTest, self).setUp() self._warnings_filters = warnings.filters warnings.filters = warnings.filters[:] warnings.filterwarnings('ignore', '.*library.find_exact.*') def tearDown(self): # noqa: N802 - super(DeprecatedCoreLibraryTest, self).tearDown() + super(DeprecatedFindExactCoreLibraryTest, self).tearDown() warnings.filters = self._warnings_filters def test_find_exact_combines_results_from_all_backends(self): diff --git a/tests/core/test_playlists.py b/tests/core/test_playlists.py index fa8c3531..dbe05733 100644 --- a/tests/core/test_playlists.py +++ b/tests/core/test_playlists.py @@ -9,7 +9,7 @@ from mopidy import backend, core from mopidy.models import Playlist, Ref, Track -class PlaylistsTest(unittest.TestCase): +class BasePlaylistsTest(unittest.TestCase): def setUp(self): # noqa: N802 self.plr1a = Ref.playlist(name='A', uri='dummy1:pl:a') self.plr1b = Ref.playlist(name='B', uri='dummy1:pl:b') @@ -50,6 +50,8 @@ class PlaylistsTest(unittest.TestCase): self.core = core.Core(mixer=None, backends=[ self.backend3, self.backend1, self.backend2]) + +class PlaylistTest(BasePlaylistsTest): def test_as_list_combines_result_from_backends(self): result = self.core.playlists.as_list()