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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/style/error_handlers_unittest.py

Issue 2679393004: Fix all "dangerous-default-value" pylint warnings. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) 1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions 4 # modification, are permitted provided that the following conditions
5 # are met: 5 # are met:
6 # 1. Redistributions of source code must retain the above copyright 6 # 1. Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # 2. Redistributions in binary form must reproduce the above copyright 8 # 2. Redistributions in binary form must reproduce the above copyright
9 # notice, this list of conditions and the following disclaimer in the 9 # notice, this list of conditions and the following disclaimer in the
10 # documentation and/or other materials provided with the distribution. 10 # documentation and/or other materials provided with the distribution.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 """Test the __eq__() method for the return value of True.""" 83 """Test the __eq__() method for the return value of True."""
84 handler1 = self._error_handler(configuration=None) 84 handler1 = self._error_handler(configuration=None)
85 handler2 = self._error_handler(configuration=None) 85 handler2 = self._error_handler(configuration=None)
86 86
87 self.assertTrue(handler1.__eq__(handler2)) 87 self.assertTrue(handler1.__eq__(handler2))
88 88
89 def test_eq__false_return_value(self): 89 def test_eq__false_return_value(self):
90 """Test the __eq__() method for the return value of False.""" 90 """Test the __eq__() method for the return value of False."""
91 def make_handler(configuration=self._style_checker_configuration(), 91 def make_handler(configuration=self._style_checker_configuration(),
92 file_path='foo.txt', increment_error_count=lambda: True , 92 file_path='foo.txt', increment_error_count=lambda: True ,
93 line_numbers=[100]): 93 line_numbers=None):
94 line_numbers = line_numbers or [100]
94 return DefaultStyleErrorHandler(configuration=configuration, 95 return DefaultStyleErrorHandler(configuration=configuration,
95 file_path=file_path, 96 file_path=file_path,
96 increment_error_count=increment_erro r_count, 97 increment_error_count=increment_erro r_count,
97 line_numbers=line_numbers) 98 line_numbers=line_numbers)
98 99
99 handler = make_handler() 100 handler = make_handler()
100 101
101 # Establish a baseline for our comparisons below. 102 # Establish a baseline for our comparisons below.
102 self.assertTrue(handler.__eq__(make_handler())) 103 self.assertTrue(handler.__eq__(make_handler()))
103 104
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 ["foo.h(50): message [whitespace/tab] [5]\n"]) 187 ["foo.h(50): message [whitespace/tab] [5]\n"])
187 188
188 # Error on non-modified line after turning off line filtering: error. 189 # Error on non-modified line after turning off line filtering: error.
189 error_handler.turn_off_line_filtering() 190 error_handler.turn_off_line_filtering()
190 self._call_error_handler(error_handler, confidence, line_number=60) 191 self._call_error_handler(error_handler, confidence, line_number=60)
191 self.assertEqual(2, self._error_count) 192 self.assertEqual(2, self._error_count)
192 self.assertEqual(self._error_messages, 193 self.assertEqual(self._error_messages,
193 ['foo.h(50): message [whitespace/tab] [5]\n', 194 ['foo.h(50): message [whitespace/tab] [5]\n',
194 'foo.h(60): message [whitespace/tab] [5]\n', 195 'foo.h(60): message [whitespace/tab] [5]\n',
195 'Suppressing further [whitespace/tab] reports for this file.\n']) 196 'Suppressing further [whitespace/tab] reports for this file.\n'])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698