Reset version when load is called

This commit is contained in:
Thomas Adamcik 2010-02-07 20:57:18 +01:00
parent 6b99572dc8
commit 8aff6a01f5
2 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class BaseCurrentPlaylistController(object):
def load(self, playlist):
self.playlist = playlist
self.version = 0
def move(self, start, end, to_position):
tracks = self.playlist.tracks

View File

@ -56,6 +56,12 @@ class BaseCurrentPlaylistControllerTest(object):
self.controller.load(new_playlist)
self.assertEqual(new_playlist, self.controller.playlist)
def test_load_resets_version(self):
self.controller.playlist = Playlist()
self.assertNotEqual(self.controller.version, 0)
self.controller.load(Playlist())
self.assertEqual(self.controller.version, 0)
# FIXME test that player switches to playing new song
@populate_playlist