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

Side by Side Diff: tests/git_cl_test.py

Issue 10447021: Automatically adds quotes on Windows when necessary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix test Created 8 years, 6 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 | « git_cl.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 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'), 105 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'),
106 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), 106 ((['git', 'symbolic-ref', 'HEAD'],), 'master'),
107 ((['git', 'config', 'branch.master.merge'],), 'master'), 107 ((['git', 'config', 'branch.master.merge'],), 'master'),
108 ((['git', 'config', 'branch.master.remote'],), 'origin'), 108 ((['git', 'config', 'branch.master.remote'],), 'origin'),
109 ((['git', 'rev-parse', '--show-cdup'],), ''), 109 ((['git', 'rev-parse', '--show-cdup'],), ''),
110 ((['git', 'rev-parse', 'HEAD'],), '12345'), 110 ((['git', 'rev-parse', 'HEAD'],), '12345'),
111 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],), 111 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],),
112 'M\t.gitignore\n'), 112 'M\t.gitignore\n'),
113 ((['git', 'config', 'branch.master.rietveldissue'],), ''), 113 ((['git', 'config', 'branch.master.rietveldissue'],), ''),
114 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''), 114 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''),
115 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'), 115 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],), 'foo'),
116 ((['git', 'config', 'user.email'],), 'me@example.com'), 116 ((['git', 'config', 'user.email'],), 'me@example.com'),
117 ((['git', 'diff', '--no-ext-diff', '--stat', '-M', 'master...'],), 117 ((['git', 'diff', '--no-ext-diff', '--stat', '-M', 'master...'],),
118 '+dat'), 118 '+dat'),
119 ((['git', 'log', '--pretty=format:%s\n\n%b', 'master..'],), 'desc\n'), 119 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],), 'desc\n'),
120 ] 120 ]
121 121
122 @staticmethod 122 @staticmethod
123 def _git_upload_calls(): 123 def _git_upload_calls():
124 return [ 124 return [
125 ((['git', 'config', 'rietveld.cc'],), ''), 125 ((['git', 'config', 'rietveld.cc'],), ''),
126 ((['git', 'config', 'branch.master.base-url'],), ''), 126 ((['git', 'config', 'branch.master.base-url'],), ''),
127 ((['git', 'config', '--get-regexp', '^svn-remote\\.'],), 127 ((['git', 'config', '--get-regexp', '^svn-remote\\.'],),
128 (('', None), 0)), 128 (('', None), 0)),
129 ((['git', 'rev-parse', '--show-cdup'],), ''), 129 ((['git', 'rev-parse', '--show-cdup'],), ''),
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'), 338 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'),
339 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), 339 ((['git', 'symbolic-ref', 'HEAD'],), 'master'),
340 ((['git', 'config', 'branch.master.merge'],), 'master'), 340 ((['git', 'config', 'branch.master.merge'],), 'master'),
341 ((['git', 'config', 'branch.master.remote'],), 'origin'), 341 ((['git', 'config', 'branch.master.remote'],), 'origin'),
342 ((['git', 'rev-parse', '--show-cdup'],), ''), 342 ((['git', 'rev-parse', '--show-cdup'],), ''),
343 ((['git', 'rev-parse', 'HEAD'],), '12345'), 343 ((['git', 'rev-parse', 'HEAD'],), '12345'),
344 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],), 344 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],),
345 'M\t.gitignore\n'), 345 'M\t.gitignore\n'),
346 ((['git', 'config', 'branch.master.rietveldissue'],), ''), 346 ((['git', 'config', 'branch.master.rietveldissue'],), ''),
347 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''), 347 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''),
348 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'), 348 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],), 'foo'),
349 ((['git', 'config', 'user.email'],), 'me@example.com'), 349 ((['git', 'config', 'user.email'],), 'me@example.com'),
350 ((['git', 'diff', '--no-ext-diff', '--stat', '-M', 'master...'],), 350 ((['git', 'diff', '--no-ext-diff', '--stat', '-M', 'master...'],),
351 '+dat'), 351 '+dat'),
352 ] 352 ]
353 353
354 @staticmethod 354 @staticmethod
355 def _gerrit_upload_calls(description, reviewers): 355 def _gerrit_upload_calls(description, reviewers):
356 calls = [ 356 calls = [
357 ((['git', 'log', '--pretty=format:%s\n\n%b', 'master..'],), 357 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],),
358 description), 358 description),
359 ((['git', 'config', 'rietveld.cc'],), '') 359 ((['git', 'config', 'rietveld.cc'],), '')
360 ] 360 ]
361 receive_pack = '--receive-pack=git receive-pack ' 361 receive_pack = '--receive-pack=git receive-pack '
362 receive_pack += '--cc=joe@example.com' # from watch list 362 receive_pack += '--cc=joe@example.com' # from watch list
363 if reviewers: 363 if reviewers:
364 receive_pack += ' ' 364 receive_pack += ' '
365 receive_pack += ' '.join(['--reviewer=' + email for email in reviewers]) 365 receive_pack += ' '.join(['--reviewer=' + email for email in reviewers])
366 receive_pack += '' 366 receive_pack += ''
367 calls += [ 367 calls += [
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 ((['git', 'config', 'rietveld.viewvc-url'],), ''), 450 ((['git', 'config', 'rietveld.viewvc-url'],), ''),
451 (('ViewVC URL:',), ''), 451 (('ViewVC URL:',), ''),
452 # DownloadHooks(True) 452 # DownloadHooks(True)
453 (('/usr/local/src/.git/hooks/commit-msg', os.X_OK,), True), 453 (('/usr/local/src/.git/hooks/commit-msg', os.X_OK,), True),
454 ] 454 ]
455 git_cl.main(['config']) 455 git_cl.main(['config'])
456 456
457 457
458 if __name__ == '__main__': 458 if __name__ == '__main__':
459 unittest.main() 459 unittest.main()
OLDNEW
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698