Add GStreamerBackendStoredPlaylistsControllerTest
This commit is contained in:
parent
23a5363ef7
commit
cf205d0eae
@ -876,3 +876,16 @@ class BasePlaybackControllerTest(object):
|
||||
def test_playing_track_that_isnt_in_playlist(self):
|
||||
test = lambda: self.playback.play(self.tracks[0])
|
||||
self.assertRaises(AssertionError, test)
|
||||
|
||||
|
||||
class BaseStoredPlaylistsControllerTest(object):
|
||||
backend_class = None
|
||||
|
||||
def setUp(self):
|
||||
self.backend = self.backend_class(mixer=DummyMixer())
|
||||
self.stored = self.backend.stored_playlists
|
||||
|
||||
def test_create(self):
|
||||
self.stored.create('test')
|
||||
playlists = filter(lambda p: p.name == 'test', self.stored.playlists)
|
||||
self.assert_(playlists)
|
||||
|
||||
@ -19,6 +19,7 @@ class GStreamerCurrentPlaylistHandlerTest(BaseCurrentPlaylistControllerTest, uni
|
||||
|
||||
backend_class = GStreamerBackend
|
||||
|
||||
|
||||
class GStreamerPlaybackControllerTest(BasePlaybackControllerTest, unittest.TestCase):
|
||||
tracks = [Track(uri=generate_song(i), id=i, length=4464) for i in range(1, 4)]
|
||||
|
||||
@ -44,5 +45,11 @@ class GStreamerPlaybackControllerTest(BasePlaybackControllerTest, unittest.TestC
|
||||
self.playback.play()
|
||||
self.assertEqual(self.playback.state, self.playback.PLAYING)
|
||||
|
||||
|
||||
class GStreamerBackendStoredPlaylistsControllerTest(BaseStoredPlaylistsControllerTest,
|
||||
unittest.TestCase):
|
||||
|
||||
backend_class = GStreamerBackend
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user