Make mpris.Previous() state change tests pass

This commit is contained in:
Stein Magnus Jodal 2011-06-07 00:07:42 +02:00
parent 5f7e905603
commit 1e73e7bbf7
2 changed files with 5 additions and 6 deletions

View File

@ -380,7 +380,7 @@ class PlaybackController(object):
def pause(self):
"""Pause playback."""
if self.state == self.PLAYING and self.provider.pause():
if self.provider.pause():
self.state = self.PAUSED
def play(self, cp_track=None, on_error_step=1):
@ -432,10 +432,9 @@ class PlaybackController(object):
will continue. If it was paused, it will still be paused, etc.
"""
if self.cp_track_at_previous is None:
return
if self.state == self.STOPPED:
return
self.change_track(self.cp_track_at_previous, on_error_step=-1)
self.stop()
else:
self.change_track(self.cp_track_at_previous, on_error_step=-1)
def resume(self):
"""If paused, resume playing the current track."""

View File

@ -555,7 +555,7 @@ class PlaybackControllerTest(object):
@populate_playlist
def test_pause_when_stopped(self):
self.playback.pause()
self.assertEqual(self.playback.state, self.playback.STOPPED)
self.assertEqual(self.playback.state, self.playback.PAUSED)
@populate_playlist
def test_pause_when_playing(self):