本文整理汇总了Python中webkitpy.common.net.layouttestresults.LayoutTestResults类的典型用法代码示例。如果您正苦于以下问题:Python LayoutTestResults类的具体用法?Python LayoutTestResults怎么用?Python LayoutTestResults使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LayoutTestResults类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_results
def test_results(self):
# Doesn't make sense to ask for the test_results until the tests have run at least once.
assert(self._test_run_counter >= 0)
failures_for_run = self._test_failure_plan[self._test_run_counter]
results = LayoutTestResults(map(self._mock_test_result, failures_for_run))
# This makes the results trustable by ExpectedFailures.
results.set_failure_limit_count(10)
return results
开发者ID:3163504123,项目名称:phantomjs,代码行数:8,代码来源:commitqueuetask_unittest.py
示例2: test_was_interrupted
def test_was_interrupted(self):
self.assertTrue(
LayoutTestResults.results_from_string('ADD_RESULTS({"tests":{},"interrupted":true});').run_was_interrupted()
)
self.assertFalse(
LayoutTestResults.results_from_string(
'ADD_RESULTS({"tests":{},"interrupted":false});'
).run_was_interrupted()
)
开发者ID:xar369,项目名称:chromium,代码行数:9,代码来源:layouttestresults_unittest.py
示例3: builder_data
def builder_data():
old_builder_data()
# have prototype-chocolate only fail on "MOCK Leopard".
self.command._builder_data['MOCK SnowLeopard'] = LayoutTestResults.results_from_string("""ADD_RESULTS({
"tests": {
"fast": {
"dom": {
"prototype-taco.html": {
"expected": "PASS",
"actual": "PASS TEXT",
"is_unexpected": true
},
"prototype-chocolate.html": {
"expected": "FAIL",
"actual": "PASS"
},
"prototype-strawberry.html": {
"expected": "PASS",
"actual": "IMAGE PASS",
"is_unexpected": true
}
}
}
}
});""")
return self.command._builder_data
开发者ID:,项目名称:,代码行数:26,代码来源:
示例4: test_parse_layout_test_results
def test_parse_layout_test_results(self):
failures = [test_failures.FailureMissingResult(), test_failures.FailureMissingImageHash(), test_failures.FailureMissingImage()]
testname = 'fast/repaint/no-caret-repaint-in-non-content-editable-element.html'
expected_results = [test_results.TestResult(testname, failures)]
results = LayoutTestResults._parse_results_html(self._example_results_html)
self.assertEqual(expected_results, results)
开发者ID:0x4d52,项目名称:JavaScriptCore-X,代码行数:7,代码来源:layouttestresults_unittest.py
示例5: fetch_layout_test_results
def fetch_layout_test_results(self, results_url):
# FIXME: This should cache that the result was a 404 and stop hitting the network.
results_file = NetworkTransaction(convert_404_to_None=True).run(lambda: self._fetch_file_from_results(results_url, "full_results.json"))
if not results_file:
results_file = NetworkTransaction(convert_404_to_None=True).run(lambda: self._fetch_file_from_results(results_url, "results.html"))
# results_from_string accepts either ORWT html or NRWT json.
return LayoutTestResults.results_from_string(results_file)
开发者ID:EQ4,项目名称:h5vcc,代码行数:8,代码来源:buildbot.py
示例6: fetch_layout_test_results
def fetch_layout_test_results(self, results_url):
"""Returns a LayoutTestResults object for results fetched from a given URL."""
results_file = NetworkTransaction(convert_404_to_None=True).run(
lambda: self._fetch_file(results_url, "failing_results.json"))
revision = NetworkTransaction(convert_404_to_None=True).run(
lambda: self._fetch_file(results_url, "LAST_CHANGE"))
if not revision:
results_file = None
return LayoutTestResults.results_from_string(results_file, revision)
开发者ID:mirror,项目名称:chromium,代码行数:9,代码来源:buildbot.py
示例7: test_unexpected_mismatch_results
def test_unexpected_mismatch_results(self):
results = LayoutTestResults.results_from_string(self.example_full_results_json)
self.assertEqual(
[r.test_name() for r in results.unexpected_mismatch_results()],
[
'fast/dom/prototype-inheritance.html',
'fast/dom/prototype-taco.html',
'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html'
])
开发者ID:ollie314,项目名称:chromium,代码行数:9,代码来源:layouttestresults_unittest.py
示例8: test_didnt_run_as_expected_results
def test_didnt_run_as_expected_results(self):
results = LayoutTestResults.results_from_string(self.example_full_results_json)
self.assertEqual(
[r.test_name() for r in results.didnt_run_as_expected_results()],
[
'fast/dom/prototype-banana.html',
'fast/dom/prototype-crashy.html',
'fast/dom/prototype-inheritance.html',
'fast/dom/prototype-newtest.html',
'fast/dom/prototype-strawberry.html',
'fast/dom/prototype-taco.html',
'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html',
])
开发者ID:mirror,项目名称:chromium,代码行数:13,代码来源:layouttestresults_unittest.py
示例9: _setup_mock_builder_data
def _setup_mock_builder_data(self):
data = LayoutTestResults.results_from_string("""ADD_RESULTS({
"tests": {
"userscripts": {
"first-test.html": {
"expected": "PASS",
"actual": "IMAGE+TEXT"
},
"second-test.html": {
"expected": "FAIL",
"actual": "IMAGE+TEXT"
}
}
}
});""")
for builder in ['MOCK builder', 'MOCK builder (Debug)', 'WebKit Mac10.7']:
self.command._builder_data[builder] = data
开发者ID:,项目名称:,代码行数:17,代码来源:
示例10: test_results_from_string
def test_results_from_string(self):
self.assertIsNone(LayoutTestResults.results_from_string(None))
self.assertIsNone(LayoutTestResults.results_from_string(""))
开发者ID:mirror,项目名称:chromium,代码行数:3,代码来源:layouttestresults_unittest.py
示例11: _create_layout_test_results
def _create_layout_test_results(self):
results_path = self._tool.port().layout_tests_results_path()
results_html = self._read_file_contents(results_path)
if not results_html:
return None
return LayoutTestResults.results_from_string(results_html)
开发者ID:Andolamin,项目名称:LunaSysMgr,代码行数:6,代码来源:layouttestresultsreader.py
示例12: test_results_from_string
def test_results_from_string(self):
self.assertEqual(LayoutTestResults.results_from_string(None), None)
self.assertEqual(LayoutTestResults.results_from_string(""), None)
开发者ID:,项目名称:,代码行数:3,代码来源:
示例13: layout_test_results
def layout_test_results(self):
if not self._layout_test_results:
# FIXME: This should cache that the result was a 404 and stop hitting the network.
self._layout_test_results = LayoutTestResults.results_from_string(self._fetch_results_html())
return self._layout_test_results
开发者ID:,项目名称:,代码行数:5,代码来源:
示例14: latest_layout_test_results
def latest_layout_test_results(self):
return LayoutTestResults.results_from_string(layouttestresults_unittest.LayoutTestResultsTest.example_full_results_json)
开发者ID:335969568,项目名称:Blink-1,代码行数:2,代码来源:buildbot_mock.py
示例15: test_missing_baseline
def test_missing_baseline(self):
results = LayoutTestResults.results_from_string(self.example_full_results_json)
missing_results = results.missing_results()
self.assertEqual(len(missing_results), 1)
self.assertEqual(missing_results[0].test_name(), "fast/dom/prototype-newtest.html")
开发者ID:ollie314,项目名称:chromium,代码行数:5,代码来源:layouttestresults_unittest.py
示例16: _create_layout_test_results
def _create_layout_test_results(self):
results_path = self._host.filesystem.join(self._results_directory, "full_results.json")
results_html = self._read_file_contents(results_path)
if not results_html:
return None
return LayoutTestResults.results_from_string(results_html)
开发者ID:3163504123,项目名称:phantomjs,代码行数:6,代码来源:layouttestresultsreader.py
示例17: print_unexpected_results
def print_unexpected_results(self, summarized_results, enabled_pixel_tests_in_retry=False):
passes = {}
flaky = {}
regressions = {}
def add_to_dict_of_lists(dict, key, value):
dict.setdefault(key, []).append(value)
def add_result(result):
test = result.test_name()
actual = result.actual_results().split(" ")
expected = result.expected_results().split(" ")
if result.did_run_as_expected():
# Don't print anything for tests that ran as expected.
return
if actual == ['PASS']:
if 'CRASH' in expected:
add_to_dict_of_lists(passes, 'Expected to crash, but passed', test)
elif 'TIMEOUT' in expected:
add_to_dict_of_lists(passes, 'Expected to timeout, but passed', test)
else:
add_to_dict_of_lists(passes, 'Expected to fail, but passed', test)
elif enabled_pixel_tests_in_retry and actual == ['TEXT', 'IMAGE+TEXT']:
add_to_dict_of_lists(regressions, actual[0], test)
elif len(actual) > 1 and bool(set(actual[1:]) & set(expected)):
# We group flaky tests by the first actual result we got.
add_to_dict_of_lists(flaky, actual[0], test)
else:
add_to_dict_of_lists(regressions, actual[0], test)
test_results = LayoutTestResults(summarized_results)
test_results.for_each_test(add_result)
if len(passes) or len(flaky) or len(regressions):
self._print("")
if len(passes):
for key, tests in passes.iteritems():
self._print("%s: (%d)" % (key, len(tests)))
tests.sort()
for test in tests:
self._print(" %s" % test)
self._print("")
self._print("")
if len(flaky):
descriptions = TestExpectations.EXPECTATION_DESCRIPTIONS
for key, tests in flaky.iteritems():
result_type = TestExpectations.EXPECTATIONS[key.lower()]
self._print("Unexpected flakiness: %s (%d)" % (descriptions[result_type], len(tests)))
tests.sort()
for test in tests:
result = test_results.result_for_test(test)
actual = result.actual_results().split(" ")
expected = result.expected_results().split(" ")
# FIXME: clean this up once the old syntax is gone
new_expectations_list = [TestExpectationLine.inverted_expectation_tokens[exp]
for exp in list(set(actual) | set(expected))]
self._print(" %s [ %s ]" % (test, " ".join(new_expectations_list)))
self._print("")
self._print("")
if len(regressions):
descriptions = TestExpectations.EXPECTATION_DESCRIPTIONS
for key, tests in regressions.iteritems():
result_type = TestExpectations.EXPECTATIONS[key.lower()]
self._print("Regressions: Unexpected %s (%d)" % (descriptions[result_type], len(tests)))
tests.sort()
for test in tests:
result = test_results.result_for_test(test)
actual = result.actual_results().split(" ")
expected = result.expected_results().split(" ")
new_expectations_list = [TestExpectationLine.inverted_expectation_tokens[exp] for exp in actual]
self._print(" %s [ %s ]" % (test, " ".join(new_expectations_list)))
self._print("")
if len(summarized_results['tests']) and self.debug_logging:
self._print("%s" % ("-" * 78))
开发者ID:mirror,项目名称:chromium,代码行数:80,代码来源:buildbot_results.py
示例18: test_tests_matching_failure_types
def test_tests_matching_failure_types(self):
results = LayoutTestResults.results_from_string(ORWTResultsHTMLParserTest._example_results_html_with_failing_tests)
failing_tests = results.tests_matching_failure_types([test_failures.FailureTextMismatch])
self.assertEqual(len(results.failing_tests()), 2)
开发者ID:,项目名称:,代码行数:4,代码来源:
示例19: test_set_failure_limit_count
def test_set_failure_limit_count(self):
results = LayoutTestResults([])
self.assertEquals(results.failure_limit_count(), None)
results.set_failure_limit_count(10)
self.assertEquals(results.failure_limit_count(), 10)
开发者ID:,项目名称:,代码行数:5,代码来源:
示例20: test_chromium_revision
def test_chromium_revision(self):
self.assertEqual(LayoutTestResults.results_from_string(self.example_full_results_json).chromium_revision(), 1234)
开发者ID:mirror,项目名称:chromium,代码行数:2,代码来源:layouttestresults_unittest.py
注:本文中的webkitpy.common.net.layouttestresults.LayoutTestResults类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论