本文整理汇总了Python中webkitpy.layout_tests.models.test_expectations.TestExpectationParser.tokenize_list方法的典型用法代码示例。如果您正苦于以下问题:Python TestExpectationParser.tokenize_list方法的具体用法?Python TestExpectationParser.tokenize_list怎么用?Python TestExpectationParser.tokenize_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.layout_tests.models.test_expectations.TestExpectationParser
的用法示例。
在下文中一共展示了TestExpectationParser.tokenize_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from webkitpy.layout_tests.models.test_expectations import TestExpectationParser [as 别名]
# 或者: from webkitpy.layout_tests.models.test_expectations.TestExpectationParser import tokenize_list [as 别名]
def execute(self, options, args, tool):
port = factory.get("chromium-win-win7") # FIXME: This should be selectable.
expectation_lines = TestExpectationParser.tokenize_list(port.test_expectations())
parser = TestExpectationParser(port, [], allow_rebaseline_modifier=False)
for expectation_line in expectation_lines:
parser.parse(expectation_line)
converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros())
tool.filesystem.write_text_file(port.path_to_test_expectations_file(), TestExpectationSerializer.list_to_string(expectation_lines, converter))
示例2: update_expectations
# 需要导入模块: from webkitpy.layout_tests.models.test_expectations import TestExpectationParser [as 别名]
# 或者: from webkitpy.layout_tests.models.test_expectations.TestExpectationParser import tokenize_list [as 别名]
def update_expectations(self, failure_info_list):
expectation_lines = TestExpectationParser.tokenize_list(self._tool.filesystem.read_text_file(self._path_to_test_expectations_file))
for expectation_line in expectation_lines:
self._parser.parse(expectation_line)
editor = TestExpectationsEditor(expectation_lines, self)
updated_expectation_lines = []
# FIXME: Group failures by testName+failureTypeList.
for failure_info in failure_info_list:
expectation_set = set(filter(lambda expectation: expectation is not None,
map(TestExpectations.expectation_from_string, failure_info['failureTypeList'])))
assert(expectation_set)
test_name = failure_info['testName']
assert(test_name)
builder_name = failure_info['builderName']
affected_test_configuration_set = self._extrapolator.extrapolate_test_configurations(builder_name)
updated_expectation_lines.extend(editor.update_expectation(test_name, affected_test_configuration_set, expectation_set))
self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectationSerializer.list_to_string(expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines))