Remove function from TextChecker

https://bugs.webkit.org/show_bug.cgi?id=125148

Patch by Tamas Gergely <tgergely.u-szeged@partner.samsung.com> on 2013-12-03
Reviewed by Darin Adler.

The process_file_data is used only from the unit tests, so it is simply moved there.

* Scripts/webkitpy/style/checkers/text.py:
(TextChecker.check):
* Scripts/webkitpy/style/checkers/text_unittest.py:
(TextStyleTestCase.process_file_data):
(TextStyleTestCase.assertNoError):
(TextStyleTestCase.assertError):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4b77b7b4
2013-12-03 Tamas Gergely <tgergely.u-szeged@partner.samsung.com>
Remove function from TextChecker
https://bugs.webkit.org/show_bug.cgi?id=125148
Reviewed by Darin Adler.
The process_file_data is used only from the unit tests, so it is simply moved there.
* Scripts/webkitpy/style/checkers/text.py:
(TextChecker.check):
* Scripts/webkitpy/style/checkers/text_unittest.py:
(TextStyleTestCase.process_file_data):
(TextStyleTestCase.assertNoError):
(TextStyleTestCase.assertError):
2013-12-03 Dániel Bátyai <Batyai.Daniel@stud.u-szeged.hu>
Remove get_test() and reference test names directly instead.
......
......@@ -42,10 +42,3 @@ class TextChecker(object):
def check(self, lines):
self._tab_checker.check(lines)
# FIXME: Remove this function (requires refactoring unit tests).
def process_file_data(filename, lines, error):
checker = TextChecker(filename, error)
checker.check(lines)
......@@ -36,6 +36,10 @@ from text import TextChecker
class TextStyleTestCase(unittest.TestCase):
"""TestCase for text_style.py"""
def process_file_data(self, filename, lines, error):
checker = TextChecker(filename, error)
checker.check(lines)
def assertNoError(self, lines):
"""Asserts that the specified lines has no errors."""
self.had_error = False
......@@ -44,7 +48,7 @@ class TextStyleTestCase(unittest.TestCase):
"""Records if an error occurs."""
self.had_error = True
text_style.process_file_data('', lines, error_for_test)
self.process_file_data('', lines, error_for_test)
self.assertFalse(self.had_error, '%s should not have any errors.' % lines)
def assertError(self, lines, expected_line_number):
......@@ -57,7 +61,7 @@ class TextStyleTestCase(unittest.TestCase):
self.assertEqual('whitespace/tab', category)
self.had_error = True
text_style.process_file_data('', lines, error_for_test)
self.process_file_data('', lines, error_for_test)
self.assertTrue(self.had_error, '%s should have an error [whitespace/tab].' % lines)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment