本文整理汇总了Python中bugimporters.trac.TracBugParser.bug_csv方法的典型用法代码示例。如果您正苦于以下问题:Python TracBugParser.bug_csv方法的具体用法?Python TracBugParser.bug_csv怎么用?Python TracBugParser.bug_csv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bugimporters.trac.TracBugParser
的用法示例。
在下文中一共展示了TracBugParser.bug_csv方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_bug_that_has_another_date_format
# 需要导入模块: from bugimporters.trac import TracBugParser [as 别名]
# 或者: from bugimporters.trac.TracBugParser import bug_csv [as 别名]
def test_create_bug_that_has_another_date_format(self):
tbp = TracBugParser('http://dsource.org/projects/tango/ticket/1939')
tbp.bug_csv = {
'cc': '',
'component': 'Documentation',
'description': "tango.core.Memory.GC.monitor() is documented incorrectly. It just duplicates previous function documentation. At least in Kai. Can't see current trunk Memory module for some reason.\\r\\n",
'id': '1939',
'keywords': 'GC.monitor',
'milestone': 'Documentation',
'owner': 'community',
'priority': 'trivial',
'reporter': '~Gh0sT~',
'resolution': '',
'status': 'new',
'summary': 'tango.core.Memory.GC.monitor() is documented incorrectly',
'type': 'defect',
'version': '0.99.9 Kai',
}
cached_html_filename = os.path.join(HERE, 'sample-data', 'dsource-1939')
tbp.set_bug_html_data(unicode(
open(cached_html_filename).read(), 'utf-8'))
got = tbp.get_parsed_data_dict(self.tm4)
wanted_date = printable_datetime(
datetime.datetime(2010, 6, 19, 8, 15, 37))
self.assertEqual(wanted_date, got['date_reported'])
self.assertEqual(wanted_date, got['last_touched'])
示例2: test_create_bug_that_has_new_date_format
# 需要导入模块: from bugimporters.trac import TracBugParser [as 别名]
# 或者: from bugimporters.trac.TracBugParser import bug_csv [as 别名]
def test_create_bug_that_has_new_date_format(self):
tbp = TracBugParser('http://trac.edgewall.org/ticket/3275')
tbp.bug_csv = {
'description': u"Hi\r\n\r\nWhen embedding sourcecode in wiki pages using the {{{-Makro, I would sometimes like to have line numbers displayed. This would make it possible to reference some lines in a text, like: \r\n\r\n''We got some c-sourcecode here, in line 1, a buffer is allocated, in line 35, some data is copied to the buffer without checking the size of the data...''\r\n\r\nThe svn browser shows line numbers, so I hope this will not be so difficult.",
'status': 'new',
'keywords': '',
'summary': 'Show line numbers when embedding source code in wiki pages',
'priority': '',
'reporter': '[email protected]\xe2\x80\xa6',
'id': '3275'}
cached_html_filename = os.path.join(HERE, 'sample-data', 'trac-3275.html')
tbp.set_bug_html_data(unicode(
open(cached_html_filename).read(), 'utf-8'))
got = tbp.get_parsed_data_dict(self.tm2)
del got['last_polled']
wanted = {'status': 'new',
'as_appears_in_distribution': u'',
'description': u"Hi\r\n\r\nWhen embedding sourcecode in wiki pages using the {{{-Makro, I would sometimes like to have line numbers displayed. This would make it possible to reference some lines in a text, like: \r\n\r\n''We got some c-sourcecode here, in line 1, a buffer is allocated, in line 35, some data is copied to the buffer without checking the size of the data...''\r\n\r\nThe svn browser shows line numbers, so I hope this will not be so difficult.",
'importance': '',
'canonical_bug_link': 'http://trac.edgewall.org/ticket/3275',
'date_reported': printable_datetime(
datetime.datetime(2006, 6, 16, 15, 1, 52)),
'submitter_realname': '',
'title': 'Show line numbers when embedding source code in wiki pages',
'people_involved': 3,
'last_touched': printable_datetime(
datetime.datetime(2010, 11, 26, 13, 45, 45)),
'submitter_username': '[email protected]\xe2\x80\xa6',
'looks_closed': False,
'good_for_newcomers': False,
'concerns_just_documentation': False,
'_project_name': 'Trac',
}
self.assertEqual(wanted, got)
示例3: test_handle_bug_html_for_new_bug
# 需要导入模块: from bugimporters.trac import TracBugParser [as 别名]
# 或者: from bugimporters.trac.TracBugParser import bug_csv [as 别名]
def test_handle_bug_html_for_new_bug(self):
tbp = TracBugParser(
bug_url='http://twistedmatrix.com/trac/ticket/4298')
tbp.bug_csv = {
'branch': '',
'branch_author': '',
'cc': 'thijs_ exarkun',
'component': 'core',
'description': "This package hasn't been touched in 4 years' \
'which either means it's stable or not being used at ' \
'all. Let's deprecate it (also see #4111).",
'id': '4298',
'keywords': 'easy',
'launchpad_bug': '',
'milestone': '',
'owner': 'djfroofy',
'priority': 'normal',
'reporter': 'thijs',
'resolution': '',
'status': 'new',
'summary': 'Deprecate twisted.persisted.journal',
'type': 'task'
}
cached_html_filename = os.path.join(HERE, 'sample-data',
'twisted-trac-4298-on-2010-04-02.html')
item = self.im.handle_bug_html(unicode(
open(cached_html_filename).read(), 'utf-8'), tbp)
# Check there is now one Bug.
assert item['title'] == 'Deprecate twisted.persisted.journal'
assert item['submitter_username'] == 'thijs'
assert item['_tracker_name'] == self.tm.tracker_name
return item
示例4: test_create_bug_object_data_dict_more_recent
# 需要导入模块: from bugimporters.trac import TracBugParser [as 别名]
# 或者: from bugimporters.trac.TracBugParser import bug_csv [as 别名]
def test_create_bug_object_data_dict_more_recent(self):
tbp = TracBugParser('http://twistedmatrix.com/trac/ticket/4298')
tbp.bug_csv = {
'branch': '',
'branch_author': '',
'cc': 'thijs_ exarkun',
'component': 'core',
'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's deprecate it (also see #4111).",
'id': '4298',
'keywords': 'easy',
'launchpad_bug': '',
'milestone': '',
'owner': 'djfroofy',
'priority': 'normal',
'reporter': 'thijs',
'resolution': '',
'status': 'new',
'summary': 'Deprecate twisted.persisted.journal',
'type': 'task'}
cached_html_filename = os.path.join(HERE, 'sample-data', 'twisted-trac-4298-on-2010-04-02.html')
tbp.set_bug_html_data(unicode(
open(cached_html_filename).read(), 'utf-8'))
self.assertEqual(tbp.component, 'core')
got = tbp.get_parsed_data_dict(self.tm)
del got['last_polled']
wanted = {'title': 'Deprecate twisted.persisted.journal',
'description': "This package hasn't been touched in 4 years which either means it's stable or not being used at all. Let's deprecate it (also see #4111).",
'status': 'new',
'importance': 'normal',
'people_involved': 3,
# FIXME: Need time zone
'date_reported': printable_datetime(
datetime.datetime(2010, 2, 23, 0, 46, 30)),
'last_touched': printable_datetime(
datetime.datetime(2010, 3, 12, 18, 43, 5)),
'looks_closed': False,
'submitter_username': 'thijs',
'submitter_realname': '',
'canonical_bug_link': 'http://twistedmatrix.com/trac/ticket/4298',
'good_for_newcomers': True,
'looks_closed': False,
'concerns_just_documentation': False,
'_project_name': 'Twisted',
'as_appears_in_distribution': '',
}
self.assertEqual(wanted, got)