mpd: added a test to check playlists names uniqueness

This commit is contained in:
Thomas Refis 2013-04-09 19:25:52 +02:00
parent 18a2d1770b
commit 5af26a226e

View File

@ -64,6 +64,16 @@ class PlaylistsHandlerTest(protocol.BaseTestCase):
self.assertInResponse('Last-Modified: 2001-03-17T13:41:17Z')
self.assertInResponse('OK')
def test_listplaylists_duplicate(self):
playlist1 = Playlist(name='a', uri='dummy:a1')
playlist2 = Playlist(name='a', uri='dummy:a2')
self.backend.playlists.playlists = [ playlist1 , playlist2 ]
self.sendRequest('listplaylists')
self.assertInResponse('playlist: a')
self.assertInResponse('playlist: a [1]')
self.assertInResponse('OK')
def test_listplaylists_ignores_playlists_without_name(self):
last_modified = datetime.datetime(2001, 3, 17, 13, 41, 17, 12345)
self.backend.playlists.playlists = [