OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Unit tests for presubmit_support.py and presubmit_canned_checks.py.""" | 6 """Unit tests for presubmit_support.py and presubmit_canned_checks.py.""" |
7 | 7 |
8 # pylint: disable=E1101,E1103 | 8 # pylint: disable=E1101,E1103 |
9 | 9 |
10 import functools | 10 import functools |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 self.mox.ReplayAll() | 1182 self.mox.ReplayAll() |
1183 members = [ | 1183 members = [ |
1184 'AbsoluteLocalPaths', 'AffectedFiles', 'AffectedSourceFiles', | 1184 'AbsoluteLocalPaths', 'AffectedFiles', 'AffectedSourceFiles', |
1185 'AffectedTextFiles', | 1185 'AffectedTextFiles', |
1186 'DEFAULT_BLACK_LIST', 'DEFAULT_WHITE_LIST', | 1186 'DEFAULT_BLACK_LIST', 'DEFAULT_WHITE_LIST', |
1187 'DepotToLocalPath', 'FilterSourceFile', 'LocalPaths', | 1187 'DepotToLocalPath', 'FilterSourceFile', 'LocalPaths', |
1188 'LocalToDepotPath', 'Command', 'RunTests', | 1188 'LocalToDepotPath', 'Command', 'RunTests', |
1189 'PresubmitLocalPath', 'ReadFile', 'RightHandSideLines', 'ServerPaths', | 1189 'PresubmitLocalPath', 'ReadFile', 'RightHandSideLines', 'ServerPaths', |
1190 'basename', 'cPickle', 'cpplint', 'cStringIO', 'canned_checks', 'change', | 1190 'basename', 'cPickle', 'cpplint', 'cStringIO', 'canned_checks', 'change', |
1191 'environ', 'glob', 'host_url', 'is_committing', 'json', 'logging', | 1191 'environ', 'glob', 'host_url', 'is_committing', 'json', 'logging', |
1192 'marshal', 'os_listdir', 'os_walk', 'os_path', 'owners_db', 'pickle', | 1192 'marshal', 'os_listdir', 'os_walk', 'os_path', 'os_stat', 'owners_db', |
1193 'platform', 'python_executable', 're', 'rietveld', 'subprocess', 'tbr', | 1193 'pickle', 'platform', 'python_executable', 're', 'rietveld', 'subprocess', |
1194 'tempfile', 'time', 'traceback', 'unittest', 'urllib2', 'version', | 1194 'tbr', 'tempfile', 'time', 'traceback', 'unittest', 'urllib2', 'version', |
1195 'verbose', | 1195 'verbose', |
1196 ] | 1196 ] |
1197 # If this test fails, you should add the relevant test. | 1197 # If this test fails, you should add the relevant test. |
1198 self.compareMembers( | 1198 self.compareMembers( |
1199 presubmit.InputApi(self.fake_change, './.', False, None, False), | 1199 presubmit.InputApi(self.fake_change, './.', False, None, False), |
1200 members) | 1200 members) |
1201 | 1201 |
1202 def testDepotToLocalPath(self): | 1202 def testDepotToLocalPath(self): |
1203 presubmit.scm.SVN._CaptureInfo(['svn://foo/smurf'], self.fake_root_dir | 1203 presubmit.scm.SVN._CaptureInfo(['svn://foo/smurf'], self.fake_root_dir |
1204 ).AndReturn({'Path': 'prout'}) | 1204 ).AndReturn({'Path': 'prout'}) |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2919 owners_check=False) | 2919 owners_check=False) |
2920 self.assertEqual(1, len(results)) | 2920 self.assertEqual(1, len(results)) |
2921 self.assertEqual( | 2921 self.assertEqual( |
2922 'Found line ending with white spaces in:', results[0]._message) | 2922 'Found line ending with white spaces in:', results[0]._message) |
2923 self.checkstdout('') | 2923 self.checkstdout('') |
2924 | 2924 |
2925 | 2925 |
2926 if __name__ == '__main__': | 2926 if __name__ == '__main__': |
2927 import unittest | 2927 import unittest |
2928 unittest.main() | 2928 unittest.main() |
OLD | NEW |