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 logging | 10 import logging |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 'BUG=123', | 945 'BUG=123', |
946 ' STORY =http://foo/ \t', | 946 ' STORY =http://foo/ \t', |
947 'and some more regular text') | 947 'and some more regular text') |
948 files = [ | 948 files = [ |
949 ['A', join('foo', 'blat.cc')], | 949 ['A', join('foo', 'blat.cc')], |
950 ['M', join('foo', 'blat', 'READ_ME2')], | 950 ['M', join('foo', 'blat', 'READ_ME2')], |
951 ['M', join('foo', 'blat', 'binary.dll')], | 951 ['M', join('foo', 'blat', 'binary.dll')], |
952 ['M', join('foo', 'blat', 'weird.xyz')], | 952 ['M', join('foo', 'blat', 'weird.xyz')], |
953 ['M', join('foo', 'blat', 'another.h')], | 953 ['M', join('foo', 'blat', 'another.h')], |
954 ['M', join('foo', 'third_party', 'third.cc')], | 954 ['M', join('foo', 'third_party', 'third.cc')], |
955 ['D', 'foo/mat/beingdeleted.txt'], | 955 ['D', join('foo', 'mat', 'beingdeleted.txt')], |
956 ['M', 'flop/notfound.txt'], | 956 ['M', join('flop', 'notfound.txt')], |
957 ['A', 'boo/flap.h'], | 957 ['A', join('boo', 'flap.h')], |
958 ] | 958 ] |
959 blat = presubmit.normpath(join(self.fake_root_dir, files[0][1])) | 959 blat = presubmit.normpath(join(self.fake_root_dir, files[0][1])) |
960 readme = presubmit.normpath(join(self.fake_root_dir, files[1][1])) | 960 readme = presubmit.normpath(join(self.fake_root_dir, files[1][1])) |
961 binary = presubmit.normpath(join(self.fake_root_dir, files[2][1])) | 961 binary = presubmit.normpath(join(self.fake_root_dir, files[2][1])) |
962 weird = presubmit.normpath(join(self.fake_root_dir, files[3][1])) | 962 weird = presubmit.normpath(join(self.fake_root_dir, files[3][1])) |
963 another = presubmit.normpath(join(self.fake_root_dir, files[4][1])) | 963 another = presubmit.normpath(join(self.fake_root_dir, files[4][1])) |
964 third_party = presubmit.normpath(join(self.fake_root_dir, files[5][1])) | 964 third_party = presubmit.normpath(join(self.fake_root_dir, files[5][1])) |
965 beingdeleted = presubmit.normpath(join(self.fake_root_dir, files[6][1])) | 965 beingdeleted = presubmit.normpath(join(self.fake_root_dir, files[6][1])) |
966 notfound = presubmit.normpath(join(self.fake_root_dir, files[7][1])) | 966 notfound = presubmit.normpath(join(self.fake_root_dir, files[7][1])) |
967 flap = presubmit.normpath(join(self.fake_root_dir, files[8][1])) | 967 flap = presubmit.normpath(join(self.fake_root_dir, files[8][1])) |
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 owners_check=False) | 2531 owners_check=False) |
2532 self.assertEqual(1, len(results)) | 2532 self.assertEqual(1, len(results)) |
2533 self.assertEqual( | 2533 self.assertEqual( |
2534 'Found line ending with white spaces in:', results[0]._message) | 2534 'Found line ending with white spaces in:', results[0]._message) |
2535 self.checkstdout('') | 2535 self.checkstdout('') |
2536 | 2536 |
2537 | 2537 |
2538 if __name__ == '__main__': | 2538 if __name__ == '__main__': |
2539 import unittest | 2539 import unittest |
2540 unittest.main() | 2540 unittest.main() |
OLD | NEW |