當前位置: 首頁>>代碼示例>>Python>>正文


Python Collector.print_feeds方法代碼示例

本文整理匯總了Python中collector.Collector.print_feeds方法的典型用法代碼示例。如果您正苦於以下問題:Python Collector.print_feeds方法的具體用法?Python Collector.print_feeds怎麽用?Python Collector.print_feeds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在collector.Collector的用法示例。


在下文中一共展示了Collector.print_feeds方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: TestCollector

# 需要導入模塊: from collector import Collector [as 別名]
# 或者: from collector.Collector import print_feeds [as 別名]

#.........這裏部分代碼省略.........
        self.assertTrue(hasattr(item_updated, "tag")) # 3
        self.assertEquals(item_updated.tag, category) # 4

    def test_has_feed(self):
        """ Tests has_feed.

        Verify with "has_feed" if the feed exists.
         1- The feed doesn't exists.

        Add a feed.

        Verify with "has_feed" if the feed exists.
         2- The feed exists.

        """
        name, url, tag = self.feed_info[0][:3]

        self.assertFalse(self.co.has_feed(name)) # 1
        self.co.add_feed(name, url, tag)
        self.assertTrue(self.co.has_feed(name)) # 2

    def test_print_feed(self):
        """ Tests print_feed.

        Add a feed.
        Print the feed.

        """
        name, url, tag = self.feed_info[0][:3]
        self.co.add_feed(name, url, tag)

        self.co.print_feed(name)

    def test_print_feeds(self):
        """ Tests print_feeds.

        Add feeds.
        print feeds.

        """
        for name, url, tag, _ in self.feed_info:
            self.co.add_feed(name, url, tag)

        self.co.print_feeds()

    def test_print_items(self):
        """ Tests print_items.

        Add a feed.
        Print items.

        """
        name, url, tag = self.feed_info[0][:3]
        self.co.add_feed(name, url, tag)

        self.co.print_items(name)

    def test_get_text_from_items(self):
        """ Tests get_text_from_items.

        Add a feed.

        For each item with "get_text_from_items" verify if: 
         1- the title is in the text.
         2- the abstract is in the text.
         3- the webpage text is in the text.
開發者ID:damiendev,項目名稱:RSS-Intelligence,代碼行數:70,代碼來源:test.py


注:本文中的collector.Collector.print_feeds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。