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

Side by Side Diff: tests/gcl_unittest.py

Issue 3171026: Disable the use of -s or --server with gcl upload. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « gcl.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) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 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 gcl.py.""" 6 """Unit tests for gcl.py."""
7 7
8 # Fixes include path. 8 # Fixes include path.
9 from super_mox import mox, SuperMoxTestBase 9 from super_mox import mox, SuperMoxTestBase
10 10
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 gcl.sys.stdout.write("\n") 318 gcl.sys.stdout.write("\n")
319 gcl.GetRepositoryRoot().AndReturn(self.fake_root_dir) 319 gcl.GetRepositoryRoot().AndReturn(self.fake_root_dir)
320 gcl.ChangeInfo.Load('naame', self.fake_root_dir, True, True 320 gcl.ChangeInfo.Load('naame', self.fake_root_dir, True, True
321 ).AndReturn(change_info) 321 ).AndReturn(change_info)
322 self.mox.ReplayAll() 322 self.mox.ReplayAll()
323 323
324 gcl.CMDupload(['naame', '--no_watchlists']) 324 gcl.CMDupload(['naame', '--no_watchlists'])
325 self.assertEquals(change_info.issue, 1) 325 self.assertEquals(change_info.issue, 1)
326 self.assertEquals(change_info.patchset, 2) 326 self.assertEquals(change_info.patchset, 2)
327 327
328 def testNoServer(self):
329 self.mox.StubOutWithMock(gcl.sys, 'stderr')
330 gcl.sys.stderr.write(
331 'Don\'t use the -s flag, fix codereview.settings instead')
332 gcl.sys.stderr.write('\n')
333 gcl.GetRepositoryRoot().AndReturn(self.fake_root_dir)
334 gcl.ChangeInfo.Load('naame', self.fake_root_dir, True, True
335 ).AndReturn(1)
336 self.mox.ReplayAll()
337
338 try:
339 gcl.CMDupload(['naame', '-s', 'foo'])
340 self.fail()
341 except SystemExit:
342 pass
343
328 344
329 if __name__ == '__main__': 345 if __name__ == '__main__':
330 import unittest 346 import unittest
331 unittest.main() 347 unittest.main()
OLDNEW
« no previous file with comments | « gcl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698