本文整理汇总了Python中models.TestResult.valueMedian方法的典型用法代码示例。如果您正苦于以下问题:Python TestResult.valueMedian方法的具体用法?Python TestResult.valueMedian怎么用?Python TestResult.valueMedian使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.TestResult
的用法示例。
在下文中一共展示了TestResult.valueMedian方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_run_from_build_and_result
# 需要导入模块: from models import TestResult [as 别名]
# 或者: from models.TestResult import valueMedian [as 别名]
def test_run_from_build_and_result(self):
branch = Branch.create_if_possible('some-branch', 'Some Branch')
platform = Platform.create_if_possible('some-platform', 'Some Platform')
builder = Builder.get(Builder.create('some-builder', 'Some Builder'))
test_name = ' some-test'
def create_build(build_number, revision):
timestamp = datetime.now().replace(microsecond=0)
build = Build(branch=branch, platform=platform, builder=builder, buildNumber=build_number,
revision=revision, timestamp=timestamp)
build.put()
return build
build = create_build(1, 101)
result = TestResult(name=test_name, value=123.0, build=build)
result.put()
self._assert_entry(Runs._entry_from_build_and_result(build, result), build, result, 123.0)
build = create_build(2, 102)
result = TestResult(name=test_name, value=456.0, valueMedian=789.0, build=build)
result.put()
self._assert_entry(Runs._entry_from_build_and_result(build, result), build, result, 456.0)
result.valueStdev = 7.0
result.put()
self._assert_entry(Runs._entry_from_build_and_result(build, result), build, result, 456.0)
result.valueStdev = None
result.valueMin = 123.0
result.valueMax = 789.0
result.put()
self._assert_entry(Runs._entry_from_build_and_result(build, result), build, result, 456.0)
result.valueStdev = 8.0
result.valueMin = 123.0
result.valueMax = 789.0
result.put()
self._assert_entry(Runs._entry_from_build_and_result(build, result), build, result, 456.0,
statistics={'stdev': 8.0, 'min': 123.0, 'max': 789.0})
result.valueMedian = 345.0 # Median is never used by the frontend.
result.valueStdev = 8.0
result.valueMin = 123.0
result.valueMax = 789.0
result.put()
self._assert_entry(Runs._entry_from_build_and_result(build, result), build, result, 456.0,
statistics={'stdev': 8.0, 'min': 123.0, 'max': 789.0})