From d70d60deed77f25d1d58322521daaad0a83c0df1 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 3 May 2010 23:17:52 +0200 Subject: [PATCH] Add deactivated integration tests for DespotifyBackend and LibspotifyBackend --- tests/backends/despotify_integrationtest.py | 35 ++++++++++++++++ tests/backends/libspotify_integrationtest.py | 42 ++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 tests/backends/despotify_integrationtest.py create mode 100644 tests/backends/libspotify_integrationtest.py diff --git a/tests/backends/despotify_integrationtest.py b/tests/backends/despotify_integrationtest.py new file mode 100644 index 00000000..1d960f77 --- /dev/null +++ b/tests/backends/despotify_integrationtest.py @@ -0,0 +1,35 @@ +# TODO This integration test is work in progress. + +import unittest + +from mopidy.backends.despotify import DespotifyBackend +from mopidy.models import Track + +from tests.backends.base import * + +uris = [ + 'spotify:track:6vqcpVcbI3Zu6sH3ieLDNt', + 'spotify:track:111sulhaZqgsnypz3MkiaW', + 'spotify:track:7t8oznvbeiAPMDRuK0R5ZT', +] + +class DespotifyCurrentPlaylistControllerTest( + BaseCurrentPlaylistControllerTest, unittest.TestCase): + tracks = [Track(uri=uri, id=i, length=4464) for i, uri in enumerate(uris)] + backend_class = DespotifyBackend + + +class DespotifyPlaybackControllerTest( + BasePlaybackControllerTest, unittest.TestCase): + tracks = [Track(uri=uri, id=i, length=4464) for i, uri in enumerate(uris)] + backend_class = DespotifyBackend + + +class DespotifyStoredPlaylistsControllerTest( + BaseStoredPlaylistsControllerTest, unittest.TestCase): + backend_class = DespotifyBackend + + +class DespotifyLibraryControllerTest( + BaseLibraryControllerTest, unittest.TestCase): + backend_class = DespotifyBackend diff --git a/tests/backends/libspotify_integrationtest.py b/tests/backends/libspotify_integrationtest.py new file mode 100644 index 00000000..6e4916f5 --- /dev/null +++ b/tests/backends/libspotify_integrationtest.py @@ -0,0 +1,42 @@ +# TODO This integration test is work in progress. + +import unittest + +from mopidy.backends.libspotify import LibspotifyBackend +from mopidy.models import Track + +from tests.backends.base import * + +uris = [ + 'spotify:track:6vqcpVcbI3Zu6sH3ieLDNt', + 'spotify:track:111sulhaZqgsnypz3MkiaW', + 'spotify:track:7t8oznvbeiAPMDRuK0R5ZT', +] + +class LibspotifyCurrentPlaylistControllerTest( + BaseCurrentPlaylistControllerTest, unittest.TestCase): + tracks = [Track(uri=uri, id=i, length=4464) for i, uri in enumerate(uris)] + backend_class = LibspotifyBackend + + +class LibspotifyPlaybackControllerTest( + BasePlaybackControllerTest, unittest.TestCase): + tracks = [Track(uri=uri, id=i, length=4464) for i, uri in enumerate(uris)] + backend_class = LibspotifyBackend + + +class LibspotifyStoredPlaylistsControllerTest( + BaseStoredPlaylistsControllerTest, unittest.TestCase): + backend_class = LibspotifyBackend + + +class LibspotifyLibraryControllerTest( + BaseLibraryControllerTest, unittest.TestCase): + backend_class = LibspotifyBackend + + +# TODO Plug this into the backend under test to avoid music output during +# testing. +class DummyAudioController(object): + def music_delivery(self, *args, **kwargs): + pass