本文整理汇总了Python中coveralls.Coveralls.create_report方法的典型用法代码示例。如果您正苦于以下问题:Python Coveralls.create_report方法的具体用法?Python Coveralls.create_report怎么用?Python Coveralls.create_report使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coveralls.Coveralls
的用法示例。
在下文中一共展示了Coveralls.create_report方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_merge_empty_data
# 需要导入模块: from coveralls import Coveralls [as 别名]
# 或者: from coveralls.Coveralls import create_report [as 别名]
def test_merge_empty_data(self, mock_requests):
api = Coveralls(repo_token='xxx')
coverage_file = tempfile.NamedTemporaryFile()
coverage_file.write(b'{}')
coverage_file.seek(0)
api.merge(coverage_file.name)
result = api.create_report()
assert json.loads(result)['source_files'] == []
示例2: test_merge
# 需要导入模块: from coveralls import Coveralls [as 别名]
# 或者: from coveralls.Coveralls import create_report [as 别名]
def test_merge(self, mock_requests):
api = Coveralls(repo_token='xxx')
coverage_file = tempfile.NamedTemporaryFile()
coverage_file.write(b'{"source_files": [{"name": "foobar", "coverage": []}]}')
coverage_file.seek(0)
api.merge(coverage_file.name)
result = api.create_report()
assert json.loads(result)['source_files'] == [{'name': 'foobar', 'coverage': []}]
示例3: test_merge_invalid_data
# 需要导入模块: from coveralls import Coveralls [as 别名]
# 或者: from coveralls.Coveralls import create_report [as 别名]
def test_merge_invalid_data(self, mock_logger, mock_requests):
api = Coveralls(repo_token='xxx')
coverage_file = tempfile.NamedTemporaryFile()
coverage_file.write(b'{"random": "stuff"}')
coverage_file.seek(0)
api.merge(coverage_file.name)
result = api.create_report()
assert json.loads(result)['source_files'] == []
mock_logger.assert_called_once_with('No data to be merged; does the '
'json file contain "source_files" data?')