本文整理汇总了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
示例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)
示例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)
示例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)
示例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
示例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)
示例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)
示例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
示例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
示例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)
示例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)