Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(781)

Unified Diff: Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py

Issue 546133003: Reformat webkitpy.layout_tests w/ format-webkitpy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py b/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
index 4077d596ff8cfb0b496e0079d297bd1e69380f98..79d158ec6a515ef9a64f4e93407fb7780d557707 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
@@ -82,13 +82,13 @@ def write_test_result(filesystem, port, results_directory, test_name, driver_out
if filesystem.exists(failure.reference_filename):
writer.write_reftest(failure.reference_filename)
else:
- _log.warn("reference %s was not found" % failure.reference_filename)
+ _log.warn('reference %s was not found' % failure.reference_filename)
elif isinstance(failure, test_failures.FailureReftestMismatchDidNotOccur):
writer.write_image_files(driver_output.image, expected_image=None)
if filesystem.exists(failure.reference_filename):
writer.write_reftest(failure.reference_filename)
else:
- _log.warn("reference %s was not found" % failure.reference_filename)
+ _log.warn('reference %s was not found' % failure.reference_filename)
else:
assert isinstance(failure, (test_failures.FailureTimeout, test_failures.FailureReftestNoImagesGenerated))
@@ -96,21 +96,22 @@ def write_test_result(filesystem, port, results_directory, test_name, driver_out
class TestResultWriter(object):
+
"""A class which handles all writing operations to the result directory."""
# Filename pieces when writing failures to the test results directory.
- FILENAME_SUFFIX_ACTUAL = "-actual"
- FILENAME_SUFFIX_EXPECTED = "-expected"
- FILENAME_SUFFIX_DIFF = "-diff"
- FILENAME_SUFFIX_STDERR = "-stderr"
- FILENAME_SUFFIX_CRASH_LOG = "-crash-log"
- FILENAME_SUFFIX_SAMPLE = "-sample"
- FILENAME_SUFFIX_LEAK_LOG = "-leak-log"
- FILENAME_SUFFIX_WDIFF = "-wdiff.html"
- FILENAME_SUFFIX_PRETTY_PATCH = "-pretty-diff.html"
- FILENAME_SUFFIX_IMAGE_DIFF = "-diff.png"
- FILENAME_SUFFIX_IMAGE_DIFFS_HTML = "-diffs.html"
- FILENAME_SUFFIX_OVERLAY = "-overlay.html"
+ FILENAME_SUFFIX_ACTUAL = '-actual'
+ FILENAME_SUFFIX_EXPECTED = '-expected'
+ FILENAME_SUFFIX_DIFF = '-diff'
+ FILENAME_SUFFIX_STDERR = '-stderr'
+ FILENAME_SUFFIX_CRASH_LOG = '-crash-log'
+ FILENAME_SUFFIX_SAMPLE = '-sample'
+ FILENAME_SUFFIX_LEAK_LOG = '-leak-log'
+ FILENAME_SUFFIX_WDIFF = '-wdiff.html'
+ FILENAME_SUFFIX_PRETTY_PATCH = '-pretty-diff.html'
+ FILENAME_SUFFIX_IMAGE_DIFF = '-diff.png'
+ FILENAME_SUFFIX_IMAGE_DIFFS_HTML = '-diffs.html'
+ FILENAME_SUFFIX_OVERLAY = '-overlay.html'
def __init__(self, filesystem, port, root_output_dir, test_name):
self._filesystem = filesystem
@@ -169,23 +170,23 @@ class TestResultWriter(object):
self._write_file(expected_filename, expected)
def write_stderr(self, error):
- filename = self.output_filename(self.FILENAME_SUFFIX_STDERR + ".txt")
+ filename = self.output_filename(self.FILENAME_SUFFIX_STDERR + '.txt')
self._write_file(filename, error)
def write_crash_log(self, crash_log):
- filename = self.output_filename(self.FILENAME_SUFFIX_CRASH_LOG + ".txt")
+ filename = self.output_filename(self.FILENAME_SUFFIX_CRASH_LOG + '.txt')
self._write_file(filename, crash_log.encode('utf8', 'replace'))
def write_leak_log(self, leak_log):
- filename = self.output_filename(self.FILENAME_SUFFIX_LEAK_LOG + ".txt")
+ filename = self.output_filename(self.FILENAME_SUFFIX_LEAK_LOG + '.txt')
self._write_file(filename, leak_log)
def copy_sample_file(self, sample_file):
- filename = self.output_filename(self.FILENAME_SUFFIX_SAMPLE + ".txt")
+ filename = self.output_filename(self.FILENAME_SUFFIX_SAMPLE + '.txt')
self._filesystem.copyfile(sample_file, filename)
def write_text_files(self, actual_text, expected_text):
- self.write_output_files(".txt", actual_text, expected_text)
+ self.write_output_files('.txt', actual_text, expected_text)
def create_text_diff_and_write_result(self, actual_text, expected_text):
# FIXME: This function is actually doing the diffs as well as writing results.

Powered by Google App Engine
This is Rietveld 408576698