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

Side by Side Diff: tests/presubmit_unittest.py

Issue 113337: Rename presubmit.py to presubmit_support.py to reduce confusion and be able t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « presubmit_support.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2006-2009 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.py and presubmit_canned_checks.py.""" 6 """Unit tests for presubmit.py and presubmit_canned_checks.py."""
7 7
8 import os 8 import os
9 import StringIO 9 import StringIO
10 import unittest 10 import unittest
11 11
12 # Local imports 12 # Local imports
13 import gcl 13 import gcl
14 import gclient 14 import gclient
15 import presubmit 15 import presubmit_support as presubmit
16 import presubmit_canned_checks 16 import presubmit_canned_checks
17 17
18 18
19 class PresubmitTestsBase(unittest.TestCase): 19 class PresubmitTestsBase(unittest.TestCase):
20 """Setups and tear downs the mocks but doesn't test anything as-is.""" 20 """Setups and tear downs the mocks but doesn't test anything as-is."""
21 def setUp(self): 21 def setUp(self):
22 self.original_IsFile = os.path.isfile 22 self.original_IsFile = os.path.isfile
23 def MockIsFile(f): 23 def MockIsFile(f):
24 dir = os.path.dirname(f) 24 dir = os.path.dirname(f)
25 return dir.endswith('haspresubmit') or dir == '' 25 return dir.endswith('haspresubmit') or dir == ''
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 self.failIf(presubmit_canned_checks.CheckTreeIsOpen( 685 self.failIf(presubmit_canned_checks.CheckTreeIsOpen(
686 self.MockInputApi(), presubmit.OutputApi, url='url_to_open', closed='0' 686 self.MockInputApi(), presubmit.OutputApi, url='url_to_open', closed='0'
687 )) 687 ))
688 self.failUnless(presubmit_canned_checks.CheckTreeIsOpen( 688 self.failUnless(presubmit_canned_checks.CheckTreeIsOpen(
689 self.MockInputApi(), presubmit.OutputApi, url='url_to_closed', closed='0' 689 self.MockInputApi(), presubmit.OutputApi, url='url_to_closed', closed='0'
690 )) 690 ))
691 691
692 692
693 if __name__ == '__main__': 693 if __name__ == '__main__':
694 unittest.main() 694 unittest.main()
OLDNEW
« no previous file with comments | « presubmit_support.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698