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

Side by Side Diff: commit-queue/tests/commit_queue_test.py

Issue 23011039: CQ: don't preserve state between runs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 7 years, 4 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 | « commit-queue/commit_queue.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/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 commit_queue.py.""" 6 """Unit tests for commit_queue.py."""
7 7
8 import os 8 import os
9 import StringIO 9 import StringIO
10 import sys 10 import sys
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 self.assertEqual('chromium', calls[0][0]) 135 self.assertEqual('chromium', calls[0][0])
136 self.assertEqual('commit-bot@chromium.org', calls[0][1]) 136 self.assertEqual('commit-bot@chromium.org', calls[0][1])
137 self.assertEqual( 137 self.assertEqual(
138 os.path.join(os.path.dirname(ROOT_DIR), 'workdir'), calls[0][2]) 138 os.path.join(os.path.dirname(ROOT_DIR), 'workdir'), calls[0][2])
139 self.assertEqual(None, calls[0][4]) 139 self.assertEqual(None, calls[0][4])
140 self._check( 140 self._check(
141 'stdout', 141 'stdout',
142 'Using read-only Rietveld\n' 142 'Using read-only Rietveld\n'
143 'Using read-only checkout\n' 143 'Using read-only checkout\n'
144 'Using read-only chromium-status interface\n') 144 'Using read-only chromium-status interface\n')
145 self._check('stderr', 'Saving db... \nDone! \n') 145 self._check('stderr', '')
146 146
147 def testDryRun(self): 147 def testDryRun(self):
148 sys.argv.extend(('--project', 'chromium')) 148 sys.argv.extend(('--project', 'chromium'))
149 pc = PendingManagerMock(self) 149 pc = PendingManagerMock(self)
150 self.mock( 150 self.mock(
151 commit_queue.projects, 151 commit_queue.projects,
152 'load_project', 152 'load_project',
153 lambda *args: pc) 153 lambda *args: pc)
154 try: 154 try:
155 commit_queue.main() 155 commit_queue.main()
156 self.fail() 156 self.fail()
157 except Stop: 157 except Stop:
158 pass 158 pass
159 self.assertEqual( 159 self.assertEqual(
160 'ReadOnlyCheckout', pc.context.checkout.__class__.__name__) 160 'ReadOnlyCheckout', pc.context.checkout.__class__.__name__)
161 # Ugh. 161 # Ugh.
162 self.assertEqual( 162 self.assertEqual(
163 'RietveldMock', pc.context.rietveld.__class__.__name__) 163 'RietveldMock', pc.context.rietveld.__class__.__name__)
164 self._check( 164 self._check(
165 'stdout', 165 'stdout',
166 'Using read-only Rietveld\n' 166 'Using read-only Rietveld\n'
167 'Using read-only checkout\n' 167 'Using read-only checkout\n'
168 'Using read-only chromium-status interface\n') 168 'Using read-only chromium-status interface\n')
169 self._check('stderr', 'Saving db... \nDone! \n') 169 self._check('stderr', '')
170 170
171 171
172 if __name__ == '__main__': 172 if __name__ == '__main__':
173 unittest.main() 173 unittest.main()
OLDNEW
« no previous file with comments | « commit-queue/commit_queue.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698