当前位置: 首页>>代码示例>>Python>>正文


Python Reporter.generate方法代码示例

本文整理汇总了Python中reporter.Reporter.generate方法的典型用法代码示例。如果您正苦于以下问题:Python Reporter.generate方法的具体用法?Python Reporter.generate怎么用?Python Reporter.generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reporter.Reporter的用法示例。


在下文中一共展示了Reporter.generate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generate_report

# 需要导入模块: from reporter import Reporter [as 别名]
# 或者: from reporter.Reporter import generate [as 别名]
def generate_report(bundle, results, options, status, html_filename,
                    json_filename):
    bundle_yaml = get_bundle_yaml(status)
    reporter = Reporter(bundle=bundle, results=results, options=options,
                        bundle_yaml=bundle_yaml)
    reporter.generate(html_filename=html_filename,
                      json_filename=json_filename)
开发者ID:marcoceppi,项目名称:cloud-weather-report,代码行数:9,代码来源:cloud_weather_report.py

示例2: test_generate_with_svg

# 需要导入模块: from reporter import Reporter [as 别名]
# 或者: from reporter.Reporter import generate [as 别名]
 def test_generate_with_svg(self):
     tempdir = mkdtemp()
     json_file = os.path.join(tempdir, 'file.json')
     html_file = os.path.join(tempdir, 'file.html')
     svg_file = os.path.join(tempdir, 'file.svg')
     results = self.make_results()
     fake_request = FakeRequest()
     args = self.make_args()
     reporter = Reporter(bundle='git', results=results, options=args,
                         bundle_yaml='bundle content')
     with patch('reporter.requests.post',
                autospec=True, return_value=fake_request) as mock_r:
         reporter.generate(html_filename=html_file, json_filename=json_file)
     mock_r.assert_called_once_with('http://svg.juju.solutions',
                                    'bundle content')
     with open(json_file) as fp:
         json_content = json.loads(fp.read())
     with open(html_file) as fp:
         html_content = fp.read()
     with open(svg_file) as fp:
         svg_content = fp.read()
     self.assertIn('charm-proof', html_content)
     self.assertEqual(json_content["bundle"]["name"], 'git')
     self.assertEqual(json_content["test_id"], '1234')
     self.assertEqual(svg_content, 'svg content')
     rmtree(tempdir)
开发者ID:marcoceppi,项目名称:cloud-weather-report,代码行数:28,代码来源:test_reporter.py

示例3: test_generate

# 需要导入模块: from reporter import Reporter [as 别名]
# 或者: from reporter.Reporter import generate [as 别名]
 def test_generate(self):
     results = self.make_results()
     reporter = Reporter(bundle='git', results=results, options=None)
     with NamedTemporaryFile() as json_file:
         with NamedTemporaryFile() as html_file:
             reporter.generate(
                 html_filename=html_file.name, json_filename=json_file.name)
             json_content = json_file.read()
             html_content = html_file.read()
     json_content = json.loads(json_content)
     self.assertIn('charm-proof', html_content)
     self.assertEqual(json_content["bundle"]["name"], 'git')
开发者ID:NhaTrang,项目名称:cloud-weather-report,代码行数:14,代码来源:test_reporter.py


注:本文中的reporter.Reporter.generate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。