Add test_delete_non_existant_playlist and test_delete_playlist
This commit is contained in:
parent
54694f63c4
commit
f4eae3af94
@ -108,3 +108,7 @@ class GStreamerStoredPlaylistsController(BaseStoredPlaylistsController):
|
|||||||
playlist = Playlist(name=name)
|
playlist = Playlist(name=name)
|
||||||
self._playlists.append(playlist)
|
self._playlists.append(playlist)
|
||||||
return playlist
|
return playlist
|
||||||
|
|
||||||
|
def delete(self, playlist):
|
||||||
|
if playlist in self._playlists:
|
||||||
|
self._playlists.remove(playlist)
|
||||||
|
|||||||
@ -891,8 +891,15 @@ class BaseStoredPlaylistsControllerTest(object):
|
|||||||
|
|
||||||
def test_create_in_playlists(self):
|
def test_create_in_playlists(self):
|
||||||
playlist = self.stored.create('test')
|
playlist = self.stored.create('test')
|
||||||
lists = filter(lambda p: p.name == 'test', self.stored.playlists)
|
self.assert_(self.stored.playlists)
|
||||||
self.assert_(lists)
|
|
||||||
|
|
||||||
def test_playlists_empty_to_start_with(self):
|
def test_playlists_empty_to_start_with(self):
|
||||||
self.assert_(not self.stored.playlists)
|
self.assert_(not self.stored.playlists)
|
||||||
|
|
||||||
|
def test_delete_non_existant_playlist(self):
|
||||||
|
self.stored.delete(Playlist())
|
||||||
|
|
||||||
|
def test_delete_playlist(self):
|
||||||
|
playlist = self.stored.create('test')
|
||||||
|
self.stored.delete(playlist)
|
||||||
|
self.assert_(not self.stored.playlists)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user