added tests for next track in single and repeat mode

This commit is contained in:
Johannes Knutsen 2010-08-14 18:30:22 +02:00
parent 074976d9f3
commit ca52dd6363

View File

@ -811,6 +811,14 @@ class BasePlaybackControllerTest(object):
self.playback.next()
self.assert_(self.tracks[0] not in self.backend.current_playlist.tracks)
@populate_playlist
def test_next_with_single_and_repeat(self):
self.playback.single = True
self.playback.repeat = True
self.playback.play()
self.playback.next()
self.assertEqual(self.playback.current_track, self.tracks[1])
@populate_playlist
def test_playlist_is_empty_after_all_tracks_are_played_with_consume(self):
self.playback.consume = True
@ -851,6 +859,14 @@ class BasePlaybackControllerTest(object):
self.playback.end_of_track_callback()
self.assertEqual(self.playback.current_track, self.tracks[1])
@populate_playlist
def test_end_of_song_with_single_and_repeat_starts_same(self):
self.playback.single = True
self.playback.repeat = True
self.playback.play()
self.playback.end_of_track_callback()
self.assertEqual(self.playback.current_track, self.tracks[0])
@populate_playlist
def test_end_of_playlist_stops(self):
self.playback.play(self.current_playlist.cp_tracks[-1])