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


Python RssNewsFeedParser.parse_xml_content方法代码示例

本文整理汇总了Python中ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser.parse_xml_content方法的典型用法代码示例。如果您正苦于以下问题:Python RssNewsFeedParser.parse_xml_content方法的具体用法?Python RssNewsFeedParser.parse_xml_content怎么用?Python RssNewsFeedParser.parse_xml_content使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser的用法示例。


在下文中一共展示了RssNewsFeedParser.parse_xml_content方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_parse_content_max_items_2

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
def test_parse_content_max_items_2():
    feed_parser = RssNewsFeedParser()

    actual = feed_parser.parse_xml_content(parse_content_input, max_items=2)

    for expected_result, actual_result in zip_longest(expected[:2], actual):
        assert expected_result == actual_result
开发者ID:mwoinoski,项目名称:crs1906,代码行数:9,代码来源:test_rss_news_feed_parser_no_class.py

示例2: test_parse_content_max_items_2

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
    def test_parse_content_max_items_2(self):
        feed_reader = RssNewsFeedParser()

        actual = feed_reader.parse_xml_content(xml_input, max_items=2)

        for expected_result, actual_result in zip_longest(expected[:2], actual):
            self.assertEquals(expected_result, actual_result)
开发者ID:mwoinoski,项目名称:crs1906,代码行数:9,代码来源:test_rss_news_feed_parser.py

示例3: test_parse_content

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
    def test_parse_content(self):
        feed_reader = RssNewsFeedParser()

        actual = feed_reader.parse_xml_content(xml_input)

        # By using itertools.zip_longest(), assertEquals() will eventually fail
        # if the lists are not the same length
        for expected_result, actual_result in zip_longest(expected, actual):
            self.assertEquals(expected_result, actual_result)
开发者ID:mwoinoski,项目名称:crs1906,代码行数:11,代码来源:test_rss_news_feed_parser.py

示例4: test_parse_content_items_missing

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
    def test_parse_content_items_missing(self):
        feed_reader = RssNewsFeedParser()

        minimal_input = "<rss><item></item></rss>"
        minimal_results = [
            {"title": "", "link": "", "date_time": "", "image_thumbnail": "", "image_banner": "", "content": ""}
        ]

        actual_results = feed_reader.parse_xml_content(minimal_input)

        self.assertEquals(minimal_results, actual_results)
开发者ID:mwoinoski,项目名称:crs1906,代码行数:13,代码来源:test_rss_news_feed_parser.py

示例5: test_parse_content_items_missing

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
def test_parse_content_items_missing():
    feed_reader = RssNewsFeedParser()

    minimal_input = '<rss><item></item></rss>'
    minimal_results = [
        {
            'title': '',
            'link': '',
            'date_time': '',
            'image_thumbnail': '',
            'image_banner': '',
            'content': ''
        }
    ]

    actual_results = feed_reader.parse_xml_content(minimal_input)

    assert minimal_results == actual_results
开发者ID:mwoinoski,项目名称:crs1906,代码行数:20,代码来源:test_rss_news_feed_parser_no_class.py

示例6: test_parse_content_items_missing

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
    def test_parse_content_items_missing(self):
        feed_reader = RssNewsFeedParser()

        minimal_input = '<rss><item></item></rss>'
        minimal_results = [
            {
                'title': '',
                'link': '',
                'date_time': '',
                'image_thumbnail': '',
                'image_banner': '',
                'content': ''
            }
        ]

        actual = feed_reader.parse_xml_content(minimal_input)

        for expected_result, actual_result in zip_longest(minimal_results,
                                                          actual):
            self.assertEquals(expected_result, actual_result)
开发者ID:mwoinoski,项目名称:crs1906,代码行数:22,代码来源:test_rss_news_feed_parser.py

示例7: test_parse_content_items_missing

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
    def test_parse_content_items_missing(self):
        """This test case will boost test coverage to 100%"""

        feed_reader = RssNewsFeedParser()

        minimal_input = '<rss><item></item></rss>'
        minimal_results = [
            {
                'title': '',
                'link': '',
                'date_time': '',
                'image_thumbnail': '',
                'image_banner': '',
                'content': ''
            }
        ]

        actual_results = feed_reader.parse_xml_content(minimal_input)

        self.assertEqual(minimal_results, actual_results)
开发者ID:mwoinoski,项目名称:crs1906,代码行数:22,代码来源:test_rss_news_feed_parser.py

示例8: test_parse_content_max_items_2

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
def test_parse_content_max_items_2():
    feed_reader = RssNewsFeedParser()

    actual = feed_reader.parse_xml_content(xml_input, max_items=2)

    assert expected[:2] == actual
开发者ID:mwoinoski,项目名称:crs1906,代码行数:8,代码来源:test_rss_news_feed_parser_no_class.py

示例9: test_parse_content

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
def test_parse_content():
    feed_reader = RssNewsFeedParser()

    actual = feed_reader.parse_xml_content(xml_input)

    assert expected == actual
开发者ID:mwoinoski,项目名称:crs1906,代码行数:8,代码来源:test_rss_news_feed_parser_no_class.py

示例10: test_parse_content_max_items_2

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
    def test_parse_content_max_items_2(self):
        feed_reader = RssNewsFeedParser()

        actual = feed_reader.parse_xml_content(xml_input, max_items=2)

        self.assertEqual(expected[:2], actual)
开发者ID:mwoinoski,项目名称:crs1906,代码行数:8,代码来源:test_rss_news_feed_parser.py

示例11: test_parse_content

# 需要导入模块: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser import RssNewsFeedParser [as 别名]
# 或者: from ticketmanor.rest_services.feed_reader.rss_news_feed_parser.RssNewsFeedParser import parse_xml_content [as 别名]
    def test_parse_content(self):
        feed_reader = RssNewsFeedParser()

        actual = feed_reader.parse_xml_content(xml_input)

        self.assertEqual(expected, actual)
开发者ID:mwoinoski,项目名称:crs1906,代码行数:8,代码来源:test_rss_news_feed_parser.py


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