本文整理汇总了Python中miro.playlist.SavedPlaylist.set_title方法的典型用法代码示例。如果您正苦于以下问题:Python SavedPlaylist.set_title方法的具体用法?Python SavedPlaylist.set_title怎么用?Python SavedPlaylist.set_title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类miro.playlist.SavedPlaylist
的用法示例。
在下文中一共展示了SavedPlaylist.set_title方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reduce_number_of_messages
# 需要导入模块: from miro.playlist import SavedPlaylist [as 别名]
# 或者: from miro.playlist.SavedPlaylist import set_title [as 别名]
def test_reduce_number_of_messages(self):
p1 = SavedPlaylist(u'Playlist')
p1.remove()
p2 = SavedPlaylist(u'Playlist 2')
p2.set_title(u'New Title')
self.runUrgentCalls()
# We don't need to see that p1 was added because it got
# removed immediately after. We don't need to see that p2 was
# changed because it will have the updated info in added.
self.check_message_count(2)
self.check_changed_message(1, added=[p2])
示例2: PlaylistTrackTest
# 需要导入模块: from miro.playlist import SavedPlaylist [as 别名]
# 或者: from miro.playlist.SavedPlaylist import set_title [as 别名]
class PlaylistTrackTest(TrackerTest):
def setUp(self):
TrackerTest.setUp(self)
self.playlist1 = SavedPlaylist(u'Playlist 1')
self.playlist2 = SavedPlaylist(u'Playlist 2')
self.folder = PlaylistFolder(u'Playlist Folder')
self.runUrgentCalls()
messages.TrackPlaylists().send_to_backend()
self.runUrgentCalls()
def test_initial_list(self):
self.assertEquals(len(self.test_handler.messages), 1)
message = self.test_handler.messages[0]
self.assert_(isinstance(message, messages.TabList))
self.assertEquals(message.type, 'playlist')
self.check_info_list(message.toplevels,
[self.playlist1, self.playlist2, self.folder])
self.check_info_list(message.folder_children[self.folder.id], [])
self.assertEquals(len(message.folder_children), 1)
def check_info(self, playlistInfo, playlist):
self.assertEquals(playlistInfo.name, playlist.get_title())
self.assertEquals(playlistInfo.id, playlist.id)
self.assertEquals(playlistInfo.is_folder,
isinstance(playlist, PlaylistFolder))
def check_changed_message_type(self, message):
self.assertEquals(type(message), messages.TabsChanged)
self.assertEquals(message.type, 'playlist')
def test_added(self):
p = SavedPlaylist(u'http://example.com/3')
self.runUrgentCalls()
self.check_message_count(2)
self.check_changed_message(1, added=[p])
def test_added_order(self):
p1 = SavedPlaylist(u'Playlist 2')
p2 = SavedPlaylist(u'Playlist 3')
p3 = SavedPlaylist(u'Playlist 4')
p4 = SavedPlaylist(u'Playlist 5')
p5 = SavedPlaylist(u'Playlist 6')
self.runUrgentCalls()
# We want the PlaylistAdded messages to come in the same order
# the feeds were added.
self.check_message_count(2)
self.check_changed_message(1, added=[p1, p2, p3, p4, p5])
def test_removed(self):
self.playlist2.remove()
self.runUrgentCalls()
self.check_message_count(2)
self.check_changed_message(1, removed=[self.playlist2])
def test_change(self):
self.playlist1.set_title(u"Booya")
self.runUrgentCalls()
self.check_message_count(2)
self.check_changed_message(1, changed=[self.playlist1])
def test_reduce_number_of_messages(self):
p1 = SavedPlaylist(u'Playlist')
p1.remove()
p2 = SavedPlaylist(u'Playlist 2')
p2.set_title(u'New Title')
self.runUrgentCalls()
# We don't need to see that p1 was added because it got
# removed immediately after. We don't need to see that p2 was
# changed because it will have the updated info in added.
self.check_message_count(2)
self.check_changed_message(1, added=[p2])
def test_stop(self):
self.check_message_count(1)
messages.StopTrackingPlaylists().send_to_backend()
self.runUrgentCalls()
self.playlist1.set_title(u"Booya")
Feed(u'http://example.com/3')
self.playlist2.remove()
self.check_message_count(1)