OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 is too confused. | 8 # pylint is too confused. |
9 # pylint: disable=E1101,E1103,R0201,W0212,W0403 | 9 # pylint: disable=E1101,E1103,R0201,W0212,W0403 |
10 | 10 |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 def testMembersChanged(self): | 786 def testMembersChanged(self): |
787 self.mox.ReplayAll() | 787 self.mox.ReplayAll() |
788 members = [ | 788 members = [ |
789 'AbsoluteLocalPaths', 'AffectedFiles', 'AffectedSourceFiles', | 789 'AbsoluteLocalPaths', 'AffectedFiles', 'AffectedSourceFiles', |
790 'AffectedTextFiles', | 790 'AffectedTextFiles', |
791 'DEFAULT_BLACK_LIST', 'DEFAULT_WHITE_LIST', | 791 'DEFAULT_BLACK_LIST', 'DEFAULT_WHITE_LIST', |
792 'DepotToLocalPath', 'FilterSourceFile', 'LocalPaths', | 792 'DepotToLocalPath', 'FilterSourceFile', 'LocalPaths', |
793 'LocalToDepotPath', | 793 'LocalToDepotPath', |
794 'PresubmitLocalPath', 'ReadFile', 'RightHandSideLines', 'ServerPaths', | 794 'PresubmitLocalPath', 'ReadFile', 'RightHandSideLines', 'ServerPaths', |
795 'basename', 'cPickle', 'cStringIO', 'canned_checks', 'change', 'environ', | 795 'basename', 'cPickle', 'cStringIO', 'canned_checks', 'change', 'environ', |
796 'host_url', 'is_committing', 'json', 'marshal', 'os_listdir', 'os_walk', | 796 'host_url', 'is_committing', 'json', 'logging', 'marshal', 'os_listdir', |
| 797 'os_walk', |
797 'os_path', 'owners_db', 'pickle', 'platform', 'python_executable', 're', | 798 'os_path', 'owners_db', 'pickle', 'platform', 'python_executable', 're', |
798 'rietveld', 'subprocess', 'tbr', 'tempfile', 'time', 'traceback', | 799 'rietveld', 'subprocess', 'tbr', 'tempfile', 'time', 'traceback', |
799 'unittest', 'urllib2', 'version', 'verbose', | 800 'unittest', 'urllib2', 'version', 'verbose', |
800 ] | 801 ] |
801 # If this test fails, you should add the relevant test. | 802 # If this test fails, you should add the relevant test. |
802 self.compareMembers( | 803 self.compareMembers( |
803 presubmit.InputApi(self.fake_change, './.', False, False, None, False), | 804 presubmit.InputApi(self.fake_change, './.', False, False, None, False), |
804 members) | 805 members) |
805 | 806 |
806 def testDepotToLocalPath(self): | 807 def testDepotToLocalPath(self): |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2157 whitelist=['^a$', '^b$'], | 2158 whitelist=['^a$', '^b$'], |
2158 blacklist=['a']) | 2159 blacklist=['a']) |
2159 self.assertEqual(results, []) | 2160 self.assertEqual(results, []) |
2160 self.checkstdout( | 2161 self.checkstdout( |
2161 'Running %s\n' % presubmit.os.path.join('random_directory', 'b')) | 2162 'Running %s\n' % presubmit.os.path.join('random_directory', 'b')) |
2162 | 2163 |
2163 | 2164 |
2164 if __name__ == '__main__': | 2165 if __name__ == '__main__': |
2165 import unittest | 2166 import unittest |
2166 unittest.main() | 2167 unittest.main() |
OLD | NEW |