| 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: disable=E1101,E1103 | 8 # pylint: disable=E1101,E1103 |
| 9 | 9 |
| 10 import logging | 10 import logging |
| 11 import os | 11 import os |
| 12 import StringIO | 12 import StringIO |
| 13 import sys | 13 import sys |
| 14 import time | 14 import time |
| 15 | 15 |
| 16 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 16 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
| 17 | 17 |
| 18 from super_mox import mox, SuperMoxTestBase | 18 from testing_support.super_mox import mox, SuperMoxTestBase |
| 19 | 19 |
| 20 import owners | 20 import owners |
| 21 import presubmit_support as presubmit | 21 import presubmit_support as presubmit |
| 22 import rietveld | 22 import rietveld |
| 23 | 23 |
| 24 # Shortcut. | 24 # Shortcut. |
| 25 presubmit_canned_checks = presubmit.presubmit_canned_checks | 25 presubmit_canned_checks = presubmit.presubmit_canned_checks |
| 26 | 26 |
| 27 | 27 |
| 28 class PresubmitTestsBase(SuperMoxTestBase): | 28 class PresubmitTestsBase(SuperMoxTestBase): |
| (...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2233 self.assertEqual(1, len(results)) | 2233 self.assertEqual(1, len(results)) |
| 2234 # pylint: disable=W0212 | 2234 # pylint: disable=W0212 |
| 2235 self.assertEqual( | 2235 self.assertEqual( |
| 2236 'Found line ending with white spaces in:', results[0]._message) | 2236 'Found line ending with white spaces in:', results[0]._message) |
| 2237 self.checkstdout('') | 2237 self.checkstdout('') |
| 2238 | 2238 |
| 2239 | 2239 |
| 2240 if __name__ == '__main__': | 2240 if __name__ == '__main__': |
| 2241 import unittest | 2241 import unittest |
| 2242 unittest.main() | 2242 unittest.main() |
| OLD | NEW |