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

Side by Side Diff: tests/git_cl_test.py

Issue 11262004: git-cl: show dirty files if any (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 1 month 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
« git_cl.py ('K') | « 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 '-M'+similarity, 'master...'],), '+dat') 125 '-M'+similarity, 'master...'],), '+dat')
126 126
127 return [ 127 return [
128 ((['git', 'config', 'gerrit.host'],), ''), 128 ((['git', 'config', 'gerrit.host'],), ''),
129 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'), 129 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'),
130 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), 130 ((['git', 'symbolic-ref', 'HEAD'],), 'master'),
131 similarity_call, 131 similarity_call,
132 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), 132 ((['git', 'symbolic-ref', 'HEAD'],), 'master'),
133 find_copies_call, 133 find_copies_call,
134 ((['git', 'update-index', '--refresh', '-q'],), ''), 134 ((['git', 'update-index', '--refresh', '-q'],), ''),
135 ((['git', 'diff-index', 'HEAD'],), ''), 135 ((['git', 'diff-index', '--name-status', 'HEAD'],), ''),
136 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), 136 ((['git', 'symbolic-ref', 'HEAD'],), 'master'),
137 ((['git', 'config', 'branch.master.merge'],), 'master'), 137 ((['git', 'config', 'branch.master.merge'],), 'master'),
138 ((['git', 'config', 'branch.master.remote'],), 'origin'), 138 ((['git', 'config', 'branch.master.remote'],), 'origin'),
139 ((['git', 'rev-parse', '--show-cdup'],), ''), 139 ((['git', 'rev-parse', '--show-cdup'],), ''),
140 ((['git', 'rev-parse', 'HEAD'],), '12345'), 140 ((['git', 'rev-parse', 'HEAD'],), '12345'),
141 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],), 141 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],),
142 'M\t.gitignore\n'), 142 'M\t.gitignore\n'),
143 ((['git', 'config', 'branch.master.rietveldissue'],), ''), 143 ((['git', 'config', 'branch.master.rietveldissue'],), ''),
144 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''), 144 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''),
145 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'), 145 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'),
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), 178 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'),
179 ((['git', 'config', '--int', '--get', 179 ((['git', 'config', '--int', '--get',
180 'branch.working.git-find-copies'],), ''), 180 'branch.working.git-find-copies'],), ''),
181 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), 181 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'),
182 ((['git', 'config', 'branch.working.merge'],), 'refs/heads/master'), 182 ((['git', 'config', 'branch.working.merge'],), 'refs/heads/master'),
183 ((['git', 'config', 'branch.working.remote'],), 'origin'), 183 ((['git', 'config', 'branch.working.remote'],), 'origin'),
184 ((['git', 'rev-list', '--merges', 184 ((['git', 'rev-list', '--merges',
185 '--grep=^SVN changes up to revision [0-9]*$', 185 '--grep=^SVN changes up to revision [0-9]*$',
186 'refs/remotes/origin/master^!'],), ''), 186 'refs/remotes/origin/master^!'],), ''),
187 ((['git', 'update-index', '--refresh', '-q'],), ''), 187 ((['git', 'update-index', '--refresh', '-q'],), ''),
188 ((['git', 'diff-index', 'HEAD'],), ''), 188 ((['git', 'diff-index', '--name-status', 'HEAD'],), ''),
189 ((['git', 'rev-list', '^refs/heads/working', 189 ((['git', 'rev-list', '^refs/heads/working',
190 'refs/remotes/origin/master'],), 190 'refs/remotes/origin/master'],),
191 ''), 191 ''),
192 ((['git', 'log', '--grep=^git-svn-id:', '-1', '--pretty=format:%H'],), 192 ((['git', 'log', '--grep=^git-svn-id:', '-1', '--pretty=format:%H'],),
193 '3fc18b62c4966193eb435baabe2d18a3810ec82e'), 193 '3fc18b62c4966193eb435baabe2d18a3810ec82e'),
194 ((['git', 'rev-list', '^3fc18b62c4966193eb435baabe2d18a3810ec82e', 194 ((['git', 'rev-list', '^3fc18b62c4966193eb435baabe2d18a3810ec82e',
195 'refs/remotes/origin/master'],), ''), 195 'refs/remotes/origin/master'],), ''),
196 ] 196 ]
197 197
198 @classmethod 198 @classmethod
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 return [ 408 return [
409 ((['git', 'config', 'gerrit.host'],), 'gerrit.example.com'), 409 ((['git', 'config', 'gerrit.host'],), 'gerrit.example.com'),
410 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'), 410 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'),
411 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), 411 ((['git', 'symbolic-ref', 'HEAD'],), 'master'),
412 ((['git', 'config', '--int', '--get', 412 ((['git', 'config', '--int', '--get',
413 'branch.master.git-cl-similarity'],), ''), 413 'branch.master.git-cl-similarity'],), ''),
414 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), 414 ((['git', 'symbolic-ref', 'HEAD'],), 'master'),
415 ((['git', 'config', '--int', '--get', 415 ((['git', 'config', '--int', '--get',
416 'branch.master.git-find-copies'],), ''), 416 'branch.master.git-find-copies'],), ''),
417 ((['git', 'update-index', '--refresh', '-q'],), ''), 417 ((['git', 'update-index', '--refresh', '-q'],), ''),
418 ((['git', 'diff-index', 'HEAD'],), ''), 418 ((['git', 'diff-index', '--name-status', 'HEAD'],), ''),
419 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), 419 ((['git', 'symbolic-ref', 'HEAD'],), 'master'),
420 ((['git', 'config', 'branch.master.merge'],), 'master'), 420 ((['git', 'config', 'branch.master.merge'],), 'master'),
421 ((['git', 'config', 'branch.master.remote'],), 'origin'), 421 ((['git', 'config', 'branch.master.remote'],), 'origin'),
422 ((['git', 'rev-parse', '--show-cdup'],), ''), 422 ((['git', 'rev-parse', '--show-cdup'],), ''),
423 ((['git', 'rev-parse', 'HEAD'],), '12345'), 423 ((['git', 'rev-parse', 'HEAD'],), '12345'),
424 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],), 424 ((['git', 'diff', '--name-status', '-r', 'master...', '.'],),
425 'M\t.gitignore\n'), 425 'M\t.gitignore\n'),
426 ((['git', 'config', 'branch.master.rietveldissue'],), ''), 426 ((['git', 'config', 'branch.master.rietveldissue'],), ''),
427 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''), 427 ((['git', 'config', 'branch.master.rietveldpatchset'],), ''),
428 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'), 428 ((['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],), 'foo'),
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 ((['git', 'config', 'rietveld.viewvc-url'],), ''), 550 ((['git', 'config', 'rietveld.viewvc-url'],), ''),
551 (('ViewVC URL:',), ''), 551 (('ViewVC URL:',), ''),
552 # DownloadHooks(True) 552 # DownloadHooks(True)
553 ((commit_msg_path, os.X_OK,), True), 553 ((commit_msg_path, os.X_OK,), True),
554 ] 554 ]
555 git_cl.main(['config']) 555 git_cl.main(['config'])
556 556
557 557
558 if __name__ == '__main__': 558 if __name__ == '__main__':
559 unittest.main() 559 unittest.main()
OLDNEW
« git_cl.py ('K') | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698