Add test for CurrentPlaylistController load and implement on base class
This commit is contained in:
parent
1bc2a28ec4
commit
0618b85bff
@ -25,6 +25,9 @@ class BaseCurrentPlaylistController(object):
|
||||
self.backend.playback.stop()
|
||||
self.playlist = Playlist()
|
||||
|
||||
def load(self, playlist):
|
||||
self.playlist = playlist
|
||||
|
||||
class BasePlaybackController(object):
|
||||
PAUSED = 'paused'
|
||||
PLAYING = 'playing'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from mopidy.models import Track
|
||||
from mopidy.models import Track, Playlist
|
||||
|
||||
class BaseCurrentPlaylistControllerTest(object):
|
||||
uris = []
|
||||
@ -50,6 +50,17 @@ class BaseCurrentPlaylistControllerTest(object):
|
||||
|
||||
self.assertEqual(playback.state, playback.STOPPED)
|
||||
|
||||
def test_load(self):
|
||||
controller = self.backend.current_playlist
|
||||
|
||||
new_playlist = Playlist()
|
||||
|
||||
self.assertNotEqual(new_playlist, controller.playlist)
|
||||
|
||||
controller.load(new_playlist)
|
||||
|
||||
self.assertEqual(new_playlist, controller.playlist)
|
||||
|
||||
class BasePlaybackControllerTest(object):
|
||||
uris = []
|
||||
backend_class = None
|
||||
|
||||
Loading…
Reference in New Issue
Block a user