Use self.playback in controller test
This commit is contained in:
parent
968a25c4fd
commit
f8c29c1dfd
@ -16,6 +16,7 @@ class BaseCurrentPlaylistControllerTest(object):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.backend = self.backend_class()
|
self.backend = self.backend_class()
|
||||||
self.controller = self.backend.current_playlist
|
self.controller = self.backend.current_playlist
|
||||||
|
self.playback = self.backend.playback
|
||||||
|
|
||||||
def test_uri_set(self):
|
def test_uri_set(self):
|
||||||
self.assert_(len(self.uris) >= 3)
|
self.assert_(len(self.uris) >= 3)
|
||||||
@ -38,28 +39,19 @@ class BaseCurrentPlaylistControllerTest(object):
|
|||||||
@populate_playlist
|
@populate_playlist
|
||||||
def test_clear(self):
|
def test_clear(self):
|
||||||
self.controller.clear()
|
self.controller.clear()
|
||||||
|
|
||||||
self.assertEqual(len(self.controller.playlist.tracks), 0)
|
self.assertEqual(len(self.controller.playlist.tracks), 0)
|
||||||
|
|
||||||
@populate_playlist
|
@populate_playlist
|
||||||
def test_clear_when_playing(self):
|
def test_clear_when_playing(self):
|
||||||
playback = self.backend.playback
|
self.playback.play()
|
||||||
|
self.assertEqual(self.playback.state, self.playback.PLAYING)
|
||||||
playback.play()
|
|
||||||
|
|
||||||
self.assertEqual(playback.state, playback.PLAYING)
|
|
||||||
|
|
||||||
self.controller.clear()
|
self.controller.clear()
|
||||||
|
self.assertEqual(self.playback.state, self.playback.STOPPED)
|
||||||
self.assertEqual(playback.state, playback.STOPPED)
|
|
||||||
|
|
||||||
def test_load(self):
|
def test_load(self):
|
||||||
new_playlist = Playlist()
|
new_playlist = Playlist()
|
||||||
|
|
||||||
self.assertNotEqual(new_playlist, self.controller.playlist)
|
self.assertNotEqual(new_playlist, self.controller.playlist)
|
||||||
|
|
||||||
self.controller.load(new_playlist)
|
self.controller.load(new_playlist)
|
||||||
|
|
||||||
self.assertEqual(new_playlist, self.controller.playlist)
|
self.assertEqual(new_playlist, self.controller.playlist)
|
||||||
|
|
||||||
class BasePlaybackControllerTest(object):
|
class BasePlaybackControllerTest(object):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user