当前位置: 首页>>代码示例>>Python>>正文


Python SavedPlaylist.set_title方法代码示例

本文整理汇总了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])
开发者ID:ShriramK,项目名称:miro,代码行数:13,代码来源:messagetest.py

示例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)
开发者ID:ShriramK,项目名称:miro,代码行数:82,代码来源:messagetest.py


注:本文中的miro.playlist.SavedPlaylist.set_title方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。