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

Side by Side Diff: tests/git_cl_test.py

Issue 11280143: Create CachingRietveld to automatically cache results for presubmit checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: add tests Created 8 years 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 | « rietveld.py ('k') | tests/rietveld_test.py » ('j') | 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/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 git_cl.py.""" 6 """Unit tests for git_cl.py."""
7 7
8 import os 8 import os
9 import StringIO 9 import StringIO
10 import stat 10 import stat
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 self.mock(subprocess2, 'check_call', self._mocked_call) 62 self.mock(subprocess2, 'check_call', self._mocked_call)
63 self.mock(subprocess2, 'check_output', self._mocked_call) 63 self.mock(subprocess2, 'check_output', self._mocked_call)
64 self.mock(subprocess2, 'communicate', self._mocked_call) 64 self.mock(subprocess2, 'communicate', self._mocked_call)
65 self.mock(subprocess2, 'Popen', self._mocked_call) 65 self.mock(subprocess2, 'Popen', self._mocked_call)
66 self.mock(git_cl, 'FindCodereviewSettingsFile', lambda: '') 66 self.mock(git_cl, 'FindCodereviewSettingsFile', lambda: '')
67 self.mock(git_cl, 'ask_for_data', self._mocked_call) 67 self.mock(git_cl, 'ask_for_data', self._mocked_call)
68 self.mock(git_cl.breakpad, 'post', self._mocked_call) 68 self.mock(git_cl.breakpad, 'post', self._mocked_call)
69 self.mock(git_cl.breakpad, 'SendStack', self._mocked_call) 69 self.mock(git_cl.breakpad, 'SendStack', self._mocked_call)
70 self.mock(git_cl.presubmit_support, 'DoPresubmitChecks', PresubmitMock) 70 self.mock(git_cl.presubmit_support, 'DoPresubmitChecks', PresubmitMock)
71 self.mock(git_cl.rietveld, 'Rietveld', RietveldMock) 71 self.mock(git_cl.rietveld, 'Rietveld', RietveldMock)
72 self.mock(git_cl.rietveld, 'CachingRietveld', RietveldMock)
72 self.mock(git_cl.upload, 'RealMain', self.fail) 73 self.mock(git_cl.upload, 'RealMain', self.fail)
73 self.mock(git_cl.watchlists, 'Watchlists', WatchlistsMock) 74 self.mock(git_cl.watchlists, 'Watchlists', WatchlistsMock)
74 # It's important to reset settings to not have inter-tests interference. 75 # It's important to reset settings to not have inter-tests interference.
75 git_cl.settings = None 76 git_cl.settings = None
76 77
77 def tearDown(self): 78 def tearDown(self):
78 if not self.has_failed(): 79 if not self.has_failed():
79 self.assertEquals([], self.calls) 80 self.assertEquals([], self.calls)
80 super(TestGitCl, self).tearDown() 81 super(TestGitCl, self).tearDown()
81 82
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 ((['git', 'config', 'rietveld.viewvc-url'],), ''), 580 ((['git', 'config', 'rietveld.viewvc-url'],), ''),
580 (('ViewVC URL:',), ''), 581 (('ViewVC URL:',), ''),
581 # DownloadHooks(True) 582 # DownloadHooks(True)
582 ((commit_msg_path, os.X_OK,), True), 583 ((commit_msg_path, os.X_OK,), True),
583 ] 584 ]
584 git_cl.main(['config']) 585 git_cl.main(['config'])
585 586
586 587
587 if __name__ == '__main__': 588 if __name__ == '__main__':
588 unittest.main() 589 unittest.main()
OLDNEW
« no previous file with comments | « rietveld.py ('k') | tests/rietveld_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698