From 9b18ff07ee58a0ea91f45d40b0918b4da491177e Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 14 Feb 2016 16:12:43 +0100 Subject: [PATCH] core: Readd regression test for #1352 Fixes #1418 Based on test that was present in 1.1.2 but dropped in the #1400 merge. --- tests/core/test_playback.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/core/test_playback.py b/tests/core/test_playback.py index 7651b9ef..a43724f0 100644 --- a/tests/core/test_playback.py +++ b/tests/core/test_playback.py @@ -1000,3 +1000,30 @@ class TestBug1177Regression(unittest.TestCase): c.playback.pause() c.playback.next() b.playback.change_track.assert_called_once_with(track2) + + +class TestBug1352Regression(BaseTest): + tracks = [ + Track(uri='dummy:a', length=40000), + Track(uri='dummy:b', length=40000), + ] + + def test_next_when_paused_updates_history(self): + self.core.history._add_track = mock.Mock() + self.core.tracklist._mark_playing = mock.Mock() + tl_tracks = self.core.tracklist.get_tl_tracks() + + self.playback.play() + self.replay_events() + + self.core.history._add_track.assert_called_once_with(self.tracks[0]) + self.core.tracklist._mark_playing.assert_called_once_with(tl_tracks[0]) + self.core.history._add_track.reset_mock() + self.core.tracklist._mark_playing.reset_mock() + + self.playback.pause() + self.playback.next() + self.replay_events() + + self.core.history._add_track.assert_called_once_with(self.tracks[1]) + self.core.tracklist._mark_playing.assert_called_once_with(tl_tracks[1])