本文整理匯總了Python中pulp.agent.lib.report.ContentReport.dict方法的典型用法代碼示例。如果您正苦於以下問題:Python ContentReport.dict方法的具體用法?Python ContentReport.dict怎麽用?Python ContentReport.dict使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pulp.agent.lib.report.ContentReport
的用法示例。
在下文中一共展示了ContentReport.dict方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_update_rendering
# 需要導入模塊: from pulp.agent.lib.report import ContentReport [as 別名]
# 或者: from pulp.agent.lib.report.ContentReport import dict [as 別名]
def test_update_rendering(self):
repo_ids = ['repo_%d' % n for n in range(0, 3)]
handler_report = ContentReport()
summary_report = SummaryReport()
summary_report.setup([{'repo_id': r} for r in repo_ids])
for r in summary_report.repository.values():
r.action = RepositoryReport.ADDED
handler_report.set_succeeded(details=summary_report.dict())
renderer = UpdateRenderer(self.context.prompt, handler_report.dict())
renderer.render()
self.assertEqual(len(self.recorder.lines), 32)
示例2: test_update_rendering_with_errors
# 需要導入模塊: from pulp.agent.lib.report import ContentReport [as 別名]
# 或者: from pulp.agent.lib.report.ContentReport import dict [as 別名]
def test_update_rendering_with_errors(self):
repo_ids = ['repo_%d' % n for n in range(0, 3)]
handler_report = ContentReport()
summary_report = SummaryReport()
summary_report.setup([{'repo_id': r} for r in repo_ids])
for r in summary_report.repository.values():
r.action = RepositoryReport.ADDED
summary_report.errors.append(UnitDownloadError('http://abc/x.rpm', repo_ids[0], dict(response_code=401)))
handler_report.set_failed(details=summary_report.dict())
renderer = UpdateRenderer(self.context.prompt, handler_report.dict())
renderer.render()
self.assertEqual(len(self.recorder.lines), 42)
示例3: test_update_rendering
# 需要導入模塊: from pulp.agent.lib.report import ContentReport [as 別名]
# 或者: from pulp.agent.lib.report.ContentReport import dict [as 別名]
def test_update_rendering(self):
repo_ids = ['repo_%d' % n for n in range(0, 3)]
handler_report = ContentReport()
summary_report = SummaryReport()
summary_report.setup([{'repo_id': r} for r in repo_ids])
for r in summary_report.repository.values():
r.action = RepositoryReport.ADDED
download_report = DownloadReport()
download_report.downloads[PRIMARY_ID] = DownloadDetails()
download_report.downloads['content-world'] = DownloadDetails()
r.sources = download_report.dict()
handler_report.set_succeeded(details=summary_report.dict())
renderer = UpdateRenderer(self.context.prompt, handler_report.dict())
renderer.render()
self.assertEqual(len(self.recorder.lines), 59)
示例4: test_update_rendering_with_message
# 需要導入模塊: from pulp.agent.lib.report import ContentReport [as 別名]
# 或者: from pulp.agent.lib.report.ContentReport import dict [as 別名]
def test_update_rendering_with_message(self):
handler_report = ContentReport()
handler_report.set_failed(details=dict(message='Authorization Failed'))
renderer = UpdateRenderer(self.context.prompt, handler_report.dict())
renderer.render()
self.assertEqual(len(self.recorder.lines), 4)