本文整理匯總了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})