Add test_play_with_consume and test_next_with_consume

This commit is contained in:
Thomas Adamcik 2010-02-18 16:25:13 +01:00
parent 865234ce6b
commit a46184dcf2
2 changed files with 13 additions and 2 deletions

View File

@ -117,6 +117,9 @@ class BasePlaybackController(object):
self.stop()
def next(self):
if self.consume:
self.backend.current_playlist.remove(self.current_track)
if not self.next_track:
self.stop()
else:

View File

@ -648,11 +648,19 @@ class BasePlaybackControllerTest(object):
self.playback.volume = 1.0 / 3 * 100
self.assertEqual(self.playback.volume, 33)
@populate_playlist
def test_play_with_consume(self):
raise NotImplementedError
self.playback.consume = True
self.playback.play()
self.assertEqual(self.playback.current_track, self.tracks[0])
@populate_playlist
def test_next_with_consume(self):
raise NotImplementedError
self.playback.consume = True
self.playback.play()
self.playback.next()
tracks = self.backend.current_playlist.playlist.tracks
self.assert_(self.tracks[0] not in tracks)
def test_previous_track_with_consume(self):
raise NotImplementedError