當前位置: 首頁>>代碼示例>>Python>>正文


Python ContentReport.dict方法代碼示例

本文整理匯總了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)
開發者ID:dhajoshi,項目名稱:pulp,代碼行數:13,代碼來源:test_admin_extensions.py

示例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)
開發者ID:dhajoshi,項目名稱:pulp,代碼行數:14,代碼來源:test_admin_extensions.py

示例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)
開發者ID:credativ,項目名稱:pulp,代碼行數:17,代碼來源:test_admin_extensions.py

示例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)
開發者ID:credativ,項目名稱:pulp,代碼行數:8,代碼來源:test_admin_extensions.py


注:本文中的pulp.agent.lib.report.ContentReport.dict方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。