本文整理汇总了Python中perceval.backends.bugzilla.Bugzilla.parse_bug_activity方法的典型用法代码示例。如果您正苦于以下问题:Python Bugzilla.parse_bug_activity方法的具体用法?Python Bugzilla.parse_bug_activity怎么用?Python Bugzilla.parse_bug_activity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类perceval.backends.bugzilla.Bugzilla
的用法示例。
在下文中一共展示了Bugzilla.parse_bug_activity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_parse_activity
# 需要导入模块: from perceval.backends.bugzilla import Bugzilla [as 别名]
# 或者: from perceval.backends.bugzilla.Bugzilla import parse_bug_activity [as 别名]
def test_parse_activity(self):
"""Test activity bug parsing"""
raw_html = read_file('data/bugzilla_bug_activity.html')
activity = Bugzilla.parse_bug_activity(raw_html)
result = [event for event in activity]
self.assertEqual(len(result), 14)
expected = {
'Who' : '[email protected]',
'When' : '2013-06-25 11:57:23 CEST',
'What' : 'Attachment #172 Attachment is obsolete',
'Removed' : '0',
'Added' : '1'
}
self.assertDictEqual(result[0], expected)
expected = {
'Who' : '[email protected]',
'When' : '2013-06-25 11:59:07 CEST',
'What' : 'Depends on',
'Removed' : '350',
'Added' : ''
}
self.assertDictEqual(result[6], expected)
示例2: test_parse_activity_no_table
# 需要导入模块: from perceval.backends.bugzilla import Bugzilla [as 别名]
# 或者: from perceval.backends.bugzilla.Bugzilla import parse_bug_activity [as 别名]
def test_parse_activity_no_table(self):
"""Test if it raises an exception the activity table is not found"""
raw_html = read_file('data/bugzilla_bug_activity_not_valid.html')
with self.assertRaises(ParseError):
activity = Bugzilla.parse_bug_activity(raw_html)
_ = [event for event in activity]
示例3: test_parse_empty_activity
# 需要导入模块: from perceval.backends.bugzilla import Bugzilla [as 别名]
# 或者: from perceval.backends.bugzilla.Bugzilla import parse_bug_activity [as 别名]
def test_parse_empty_activity(self):
"""Test the parser when the activity table is empty"""
raw_html = read_file('data/bugzilla_bug_activity_empty.html')
activity = Bugzilla.parse_bug_activity(raw_html)
result = [event for event in activity]
self.assertEqual(len(result), 0)
示例4: test_parse_empty_activity
# 需要导入模块: from perceval.backends.bugzilla import Bugzilla [as 别名]
# 或者: from perceval.backends.bugzilla.Bugzilla import parse_bug_activity [as 别名]
def test_parse_empty_activity(self):
"""Test the parser when the activity table is empty"""
# There are two possible cases for empty tables.
# The first case includes the term 'bug' while the second
# one replaces it by 'issue'.
raw_html = read_file('data/bugzilla_bug_activity_empty.html')
activity = Bugzilla.parse_bug_activity(raw_html)
result = [event for event in activity]
self.assertEqual(len(result), 0)
raw_html = read_file('data/bugzilla_bug_activity_empty_alt.html')
activity = Bugzilla.parse_bug_activity(raw_html)
result = [event for event in activity]
self.assertEqual(len(result), 0)