OLD | NEW |
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 if find_copies: | 157 if find_copies: |
158 stat_call = ((['git', 'diff', '--no-ext-diff', '--stat', | 158 stat_call = ((['git', 'diff', '--no-ext-diff', '--stat', |
159 '--find-copies-harder', '-l100000', '-C'+similarity, | 159 '--find-copies-harder', '-l100000', '-C'+similarity, |
160 'fake_ancestor_sha', 'HEAD'],), '+dat') | 160 'fake_ancestor_sha', 'HEAD'],), '+dat') |
161 else: | 161 else: |
162 stat_call = ((['git', 'diff', '--no-ext-diff', '--stat', | 162 stat_call = ((['git', 'diff', '--no-ext-diff', '--stat', |
163 '-M'+similarity, 'fake_ancestor_sha', 'HEAD'],), '+dat') | 163 '-M'+similarity, 'fake_ancestor_sha', 'HEAD'],), '+dat') |
164 | 164 |
165 return [ | 165 return [ |
| 166 ((['git', 'config', 'rietveld.autoupdate'],), ''), |
| 167 ((['git', 'config', 'rietveld.server'],), |
| 168 'codereview.example.com'), |
166 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 169 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
167 similarity_call, | 170 similarity_call, |
168 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 171 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
169 find_copies_call, | 172 find_copies_call, |
170 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 173 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
171 ((['git', 'config', 'branch.master.rietveldissue'],), ''), | |
172 ((['git', 'config', 'branch.master.gerritissue'],), ''), | |
173 ((['git', 'config', 'rietveld.autoupdate'],), ''), | |
174 ((['git', 'config', 'gerrit.host'],), ''), | |
175 ((['git', 'config', 'rietveld.server'],), | |
176 'codereview.example.com'), | |
177 ((['git', 'config', 'branch.master.merge'],), 'master'), | 174 ((['git', 'config', 'branch.master.merge'],), 'master'), |
178 ((['git', 'config', 'branch.master.remote'],), 'origin'), | 175 ((['git', 'config', 'branch.master.remote'],), 'origin'), |
179 ((['get_or_create_merge_base', 'master', 'master'],), | 176 ((['get_or_create_merge_base', 'master', 'master'],), |
180 'fake_ancestor_sha'), | 177 'fake_ancestor_sha'), |
| 178 ((['git', 'config', 'gerrit.host'],), ''), |
| 179 ((['git', 'config', 'branch.master.rietveldissue'],), ''), |
181 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [ | 180 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [ |
182 ((['git', 'rev-parse', '--show-cdup'],), ''), | 181 ((['git', 'rev-parse', '--show-cdup'],), ''), |
183 ((['git', 'rev-parse', 'HEAD'],), '12345'), | 182 ((['git', 'rev-parse', 'HEAD'],), '12345'), |
184 ((['git', 'diff', '--name-status', '--no-renames', '-r', | 183 ((['git', 'diff', '--name-status', '--no-renames', '-r', |
185 'fake_ancestor_sha...', '.'],), | 184 'fake_ancestor_sha...', '.'],), |
186 'M\t.gitignore\n'), | 185 'M\t.gitignore\n'), |
187 ((['git', 'config', 'branch.master.rietveldpatchset'],), | 186 ((['git', 'config', 'branch.master.rietveldpatchset'],), |
188 ''), | 187 ''), |
189 ((['git', 'log', '--pretty=format:%s%n%n%b', | 188 ((['git', 'log', '--pretty=format:%s%n%n%b', |
190 'fake_ancestor_sha...'],), | 189 'fake_ancestor_sha...'],), |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 ((['git', 'config', 'rietveld.autoupdate'],), | 272 ((['git', 'config', 'rietveld.autoupdate'],), |
274 ''), | 273 ''), |
275 ((['git', 'config', 'rietveld.pending-ref-prefix'],), | 274 ((['git', 'config', 'rietveld.pending-ref-prefix'],), |
276 ''), | 275 ''), |
277 ((['git', | 276 ((['git', |
278 'config', '--local', '--get-regexp', '^svn-remote\\.'],), | 277 'config', '--local', '--get-regexp', '^svn-remote\\.'],), |
279 ((('svn-remote.svn.url svn://svn.chromium.org/chrome\n' | 278 ((('svn-remote.svn.url svn://svn.chromium.org/chrome\n' |
280 'svn-remote.svn.fetch trunk/src:refs/remotes/origin/master'), | 279 'svn-remote.svn.fetch trunk/src:refs/remotes/origin/master'), |
281 None), | 280 None), |
282 0)), | 281 0)), |
| 282 ((['git', |
| 283 'config', 'rietveld.server'],), 'codereview.example.com'), |
283 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), | 284 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), |
284 ((['git', 'config', '--int', '--get', | 285 ((['git', 'config', '--int', '--get', |
285 'branch.working.git-cl-similarity'],), ''), | 286 'branch.working.git-cl-similarity'],), ''), |
286 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), | 287 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), |
287 ((['git', 'config', '--int', '--get', | 288 ((['git', 'config', '--int', '--get', |
288 'branch.working.git-find-copies'],), ''), | 289 'branch.working.git-find-copies'],), ''), |
289 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), | 290 ((['git', 'symbolic-ref', 'HEAD'],), 'refs/heads/working'), |
290 ((['git', | 291 ((['git', |
291 'config', 'branch.working.rietveldissue'],), '12345'), | |
292 ((['git', | |
293 'config', 'rietveld.server'],), 'codereview.example.com'), | |
294 ((['git', | |
295 'config', 'branch.working.merge'],), 'refs/heads/master'), | 292 'config', 'branch.working.merge'],), 'refs/heads/master'), |
296 ((['git', 'config', 'branch.working.remote'],), 'origin'), | 293 ((['git', 'config', 'branch.working.remote'],), 'origin'), |
297 ((['git', 'config', 'branch.working.merge'],), | 294 ((['git', 'config', 'branch.working.merge'],), |
298 'refs/heads/master'), | 295 'refs/heads/master'), |
299 ((['git', 'config', 'branch.working.remote'],), 'origin'), | 296 ((['git', 'config', 'branch.working.remote'],), 'origin'), |
300 ((['git', 'rev-list', '--merges', | 297 ((['git', 'rev-list', '--merges', |
301 '--grep=^SVN changes up to revision [0-9]*$', | 298 '--grep=^SVN changes up to revision [0-9]*$', |
302 'refs/remotes/origin/master^!'],), ''), | 299 'refs/remotes/origin/master^!'],), ''), |
303 ((['git', 'rev-list', '^refs/heads/working', | 300 ((['git', 'rev-list', '^refs/heads/working', |
304 'refs/remotes/origin/master'],), | 301 'refs/remotes/origin/master'],), |
(...skipping 13 matching lines...) Expand all Loading... |
318 def _dcommit_calls_normal(cls): | 315 def _dcommit_calls_normal(cls): |
319 return [ | 316 return [ |
320 ((['git', 'rev-parse', '--show-cdup'],), ''), | 317 ((['git', 'rev-parse', '--show-cdup'],), ''), |
321 ((['git', 'rev-parse', 'HEAD'],), | 318 ((['git', 'rev-parse', 'HEAD'],), |
322 '00ff397798ea57439712ed7e04ab96e13969ef40'), | 319 '00ff397798ea57439712ed7e04ab96e13969ef40'), |
323 ((['git', | 320 ((['git', |
324 'diff', '--name-status', '--no-renames', '-r', 'fake_ancestor_sha...', | 321 'diff', '--name-status', '--no-renames', '-r', 'fake_ancestor_sha...', |
325 '.'],), | 322 '.'],), |
326 'M\tPRESUBMIT.py'), | 323 'M\tPRESUBMIT.py'), |
327 ((['git', | 324 ((['git', |
| 325 'config', 'branch.working.rietveldissue'],), '12345'), |
| 326 ((['git', |
328 'config', 'branch.working.rietveldpatchset'],), '31137'), | 327 'config', 'branch.working.rietveldpatchset'],), '31137'), |
329 ((['git', 'config', 'branch.working.rietveldserver'],), | 328 ((['git', 'config', 'branch.working.rietveldserver'],), |
330 'codereview.example.com'), | 329 'codereview.example.com'), |
331 ((['git', 'config', 'user.email'],), 'author@example.com'), | 330 ((['git', 'config', 'user.email'],), 'author@example.com'), |
332 ((['git', 'config', 'rietveld.tree-status-url'],), ''), | 331 ((['git', 'config', 'rietveld.tree-status-url'],), ''), |
333 ] | 332 ] |
334 | 333 |
335 @classmethod | 334 @classmethod |
336 def _dcommit_calls_bypassed(cls): | 335 def _dcommit_calls_bypassed(cls): |
337 return [ | 336 return [ |
| 337 ((['git', |
| 338 'config', 'branch.working.rietveldissue'],), '12345'), |
338 ((['git', 'config', 'branch.working.rietveldserver'],), | 339 ((['git', 'config', 'branch.working.rietveldserver'],), |
339 'codereview.example.com'), | 340 'codereview.example.com'), |
340 ] | 341 ] |
341 | 342 |
342 @classmethod | 343 @classmethod |
343 def _dcommit_calls_3(cls): | 344 def _dcommit_calls_3(cls): |
344 return [ | 345 return [ |
| 346 ((['git', 'config', 'gerrit.host'],), ''), |
345 ((['git', | 347 ((['git', |
346 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', | 348 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', |
347 '-l100000', '-C50', 'fake_ancestor_sha', | 349 '-l100000', '-C50', 'fake_ancestor_sha', |
348 'refs/heads/working'],), | 350 'refs/heads/working'],), |
349 (' PRESUBMIT.py | 2 +-\n' | 351 (' PRESUBMIT.py | 2 +-\n' |
350 ' 1 files changed, 1 insertions(+), 1 deletions(-)\n')), | 352 ' 1 files changed, 1 insertions(+), 1 deletions(-)\n')), |
351 ((['git', 'show-ref', '--quiet', '--verify', | 353 ((['git', 'show-ref', '--quiet', '--verify', |
352 'refs/heads/git-cl-commit'],), | 354 'refs/heads/git-cl-commit'],), |
353 (('', None), 0)), | 355 (('', None), 0)), |
354 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), | 356 ((['git', 'branch', '-D', 'git-cl-commit'],), ''), |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 self.calls = ( | 539 self.calls = ( |
538 self._dcommit_calls_1() + | 540 self._dcommit_calls_1() + |
539 self._dcommit_calls_bypassed() + | 541 self._dcommit_calls_bypassed() + |
540 self._dcommit_calls_3()) | 542 self._dcommit_calls_3()) |
541 git_cl.main(['dcommit', '--bypass-hooks']) | 543 git_cl.main(['dcommit', '--bypass-hooks']) |
542 | 544 |
543 | 545 |
544 @classmethod | 546 @classmethod |
545 def _gerrit_base_calls(cls): | 547 def _gerrit_base_calls(cls): |
546 return [ | 548 return [ |
| 549 ((['git', 'config', 'rietveld.autoupdate'],), |
| 550 ''), |
| 551 ((['git', |
| 552 'config', 'rietveld.server'],), 'codereview.example.com'), |
547 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 553 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
548 ((['git', 'config', '--int', '--get', | 554 ((['git', 'config', '--int', '--get', |
549 'branch.master.git-cl-similarity'],), ''), | 555 'branch.master.git-cl-similarity'],), ''), |
550 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 556 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
551 ((['git', 'config', '--int', '--get', | 557 ((['git', 'config', '--int', '--get', |
552 'branch.master.git-find-copies'],), ''), | 558 'branch.master.git-find-copies'],), ''), |
553 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | 559 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), |
554 ((['git', 'config', 'branch.master.rietveldissue'],), ''), | |
555 ((['git', 'config', 'branch.master.gerritissue'],), ''), | |
556 ((['git', 'config', 'rietveld.autoupdate'],), ''), | |
557 ((['git', 'config', 'gerrit.host'],), 'True'), | |
558 ((['git', 'config', 'branch.master.merge'],), 'master'), | 560 ((['git', 'config', 'branch.master.merge'],), 'master'), |
559 ((['git', 'config', 'branch.master.remote'],), 'origin'), | 561 ((['git', 'config', 'branch.master.remote'],), 'origin'), |
560 ((['get_or_create_merge_base', 'master', 'master'],), | 562 ((['get_or_create_merge_base', 'master', 'master'],), |
561 'fake_ancestor_sha'), | 563 'fake_ancestor_sha'), |
562 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [ | 564 ((['git', 'config', 'gerrit.host'],), 'True'), |
| 565 ] + cls._git_sanity_checks('fake_ancestor_sha', 'master') + [ |
563 ((['git', 'rev-parse', '--show-cdup'],), ''), | 566 ((['git', 'rev-parse', '--show-cdup'],), ''), |
564 ((['git', 'rev-parse', 'HEAD'],), '12345'), | 567 ((['git', 'rev-parse', 'HEAD'],), '12345'), |
565 ((['git', | 568 ((['git', |
566 'diff', '--name-status', '--no-renames', '-r', | 569 'diff', '--name-status', '--no-renames', '-r', |
567 'fake_ancestor_sha...', '.'],), | 570 'fake_ancestor_sha...', '.'],), |
568 'M\t.gitignore\n'), | 571 'M\t.gitignore\n'), |
569 ((['git', 'config', 'branch.master.gerritpatchset'],), ''), | 572 ((['git', 'config', 'branch.master.rietveldissue'],), ''), |
| 573 ((['git', |
| 574 'config', 'branch.master.rietveldpatchset'],), ''), |
570 ((['git', | 575 ((['git', |
571 'log', '--pretty=format:%s%n%n%b', 'fake_ancestor_sha...'],), | 576 'log', '--pretty=format:%s%n%n%b', 'fake_ancestor_sha...'],), |
572 'foo'), | 577 'foo'), |
573 ((['git', 'config', 'user.email'],), 'me@example.com'), | 578 ((['git', 'config', 'user.email'],), 'me@example.com'), |
574 ((['git', | 579 ((['git', |
575 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', | 580 'diff', '--no-ext-diff', '--stat', '--find-copies-harder', |
576 '-l100000', '-C50', 'fake_ancestor_sha', 'HEAD'],), | 581 '-l100000', '-C50', 'fake_ancestor_sha', 'HEAD'],), |
577 '+dat'), | 582 '+dat'), |
578 ] | 583 ] |
579 | 584 |
580 @classmethod | 585 @classmethod |
581 def _gerrit_upload_calls(cls, description, reviewers, squash, | 586 def _gerrit_upload_calls(cls, description, reviewers, squash, |
582 expected_upstream_ref='origin/refs/heads/master', | 587 expected_upstream_ref='origin/refs/heads/master', |
583 post_amend_description=None): | 588 post_amend_description=None): |
584 if post_amend_description is None: | 589 if post_amend_description is None: |
585 post_amend_description = description | 590 post_amend_description = description |
586 calls = [ | 591 calls = [ |
587 ((['git', 'config', '--bool', 'gerrit.squash-uploads'],), 'false'), | 592 ((['git', 'config', '--bool', 'gerrit.squash-uploads'],), 'false'), |
588 ((['git', 'log', '--pretty=format:%s\n\n%b', | 593 ((['git', 'log', '--pretty=format:%s\n\n%b', |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 'remote: Processing changes: new: 1, done\n' | 655 'remote: Processing changes: new: 1, done\n' |
651 'remote:\n' | 656 'remote:\n' |
652 'remote: New Changes:\n' | 657 'remote: New Changes:\n' |
653 'remote: https://chromium-review.googlesource.com/123456 XXX.\n' | 658 'remote: https://chromium-review.googlesource.com/123456 XXX.\n' |
654 'remote:\n' | 659 'remote:\n' |
655 'To https://chromium.googlesource.com/yyy/zzz\n' | 660 'To https://chromium.googlesource.com/yyy/zzz\n' |
656 ' * [new branch] hhhh -> refs/for/refs/heads/master\n')), | 661 ' * [new branch] hhhh -> refs/for/refs/heads/master\n')), |
657 ] | 662 ] |
658 if squash: | 663 if squash: |
659 calls += [ | 664 calls += [ |
660 ((['git', 'config', 'branch.master.gerritissue', '123456'],), ''), | 665 ((['git', 'config', 'branch.master.rietveldissue', '123456'],), ''), |
661 ((['git', 'config', 'branch.master.gerritserver'],), ''), | |
662 ((['git', 'config', 'remote.origin.url'],), | |
663 'https://chromium.googlesource.com/my/repo.git'), | |
664 ((['git', 'config', 'branch.master.gerritserver', | |
665 'https://chromium-review.googlesource.com'],), ''), | |
666 ((['git', 'rev-parse', 'HEAD'],), 'abcdef0123456789'), | 666 ((['git', 'rev-parse', 'HEAD'],), 'abcdef0123456789'), |
667 ((['git', 'update-ref', '-m', 'Uploaded abcdef0123456789', | 667 ((['git', 'update-ref', '-m', 'Uploaded abcdef0123456789', |
668 'refs/heads/git_cl_uploads/master', 'abcdef0123456789'],), | 668 'refs/heads/git_cl_uploads/master', 'abcdef0123456789'],), |
669 '') | 669 '') |
670 ] | 670 ] |
671 calls += cls._git_post_upload_calls() | 671 calls += cls._git_post_upload_calls() |
672 return calls | 672 return calls |
673 | 673 |
674 def _run_gerrit_upload_test( | 674 def _run_gerrit_upload_test( |
675 self, | 675 self, |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 # Patch when local tree is dirty | 879 # Patch when local tree is dirty |
880 self.mock(git_common, 'is_dirty_git_tree', lambda x: True) | 880 self.mock(git_common, 'is_dirty_git_tree', lambda x: True) |
881 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) | 881 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) |
882 | 882 |
883 def test_diff_when_dirty(self): | 883 def test_diff_when_dirty(self): |
884 # Do 'git cl diff' when local tree is dirty | 884 # Do 'git cl diff' when local tree is dirty |
885 self.mock(git_common, 'is_dirty_git_tree', lambda x: True) | 885 self.mock(git_common, 'is_dirty_git_tree', lambda x: True) |
886 self.assertNotEqual(git_cl.main(['diff']), 0) | 886 self.assertNotEqual(git_cl.main(['diff']), 0) |
887 | 887 |
888 def _patch_common(self): | 888 def _patch_common(self): |
889 self.mock(git_cl._RietveldChangelistImpl, 'GetMostRecentPatchset', | 889 self.mock(git_cl.Changelist, 'GetMostRecentPatchset', lambda x: '60001') |
890 lambda x: '60001') | 890 self.mock(git_cl.Changelist, 'GetPatchSetDiff', lambda *args: None) |
891 self.mock(git_cl._RietveldChangelistImpl, 'GetPatchSetDiff', | 891 self.mock(git_cl.Changelist, 'GetDescription', lambda *args: 'Description') |
892 lambda *args: None) | |
893 self.mock(git_cl.Changelist, 'GetDescription', | |
894 lambda *args: 'Description') | |
895 self.mock(git_cl.Changelist, 'SetIssue', lambda *args: None) | 892 self.mock(git_cl.Changelist, 'SetIssue', lambda *args: None) |
896 self.mock(git_cl.Changelist, 'SetPatchset', lambda *args: None) | 893 self.mock(git_cl.Changelist, 'SetPatchset', lambda *args: None) |
897 self.mock(git_cl, 'IsGitVersionAtLeast', lambda *args: True) | 894 self.mock(git_cl, 'IsGitVersionAtLeast', lambda *args: True) |
898 | 895 |
899 self.calls = [ | 896 self.calls = [ |
900 ((['git', 'config', 'rietveld.autoupdate'],), ''), | 897 ((['git', 'config', 'rietveld.autoupdate'],), ''), |
901 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'), | 898 ((['git', 'config', 'rietveld.server'],), 'codereview.example.com'), |
902 ((['git', 'rev-parse', '--show-cdup'],), ''), | 899 ((['git', 'rev-parse', '--show-cdup'],), ''), |
903 ((['sed', '-e', 's|^--- a/|--- |; s|^+++ b/|+++ |'],), ''), | 900 ((['sed', '-e', 's|^--- a/|--- |; s|^+++ b/|+++ |'],), ''), |
904 ] | 901 ] |
905 | 902 |
906 def test_patch_successful(self): | 903 def test_patch_successful(self): |
907 self._patch_common() | 904 self._patch_common() |
908 self.calls += [ | 905 self.calls += [ |
909 ((['git', 'apply', '--index', '-p0', '--3way'],), ''), | 906 ((['git', 'apply', '--index', '-p0', '--3way'],), ''), |
910 ((['git', 'commit', '-m', | 907 ((['git', 'commit', '-m', |
911 'Description\n\n' + | 908 'Description\n\n' + |
912 'patch from issue 123456 at patchset 60001 ' + | 909 'patch from issue 123456 at patchset 60001 ' + |
913 '(http://crrev.com/123456#ps60001)'],), ''), | 910 '(http://crrev.com/123456#ps60001)'],), ''), |
914 ((['git', 'symbolic-ref', 'HEAD'],), 'master'), | |
915 ((['git', 'config', 'branch.master.rietveldserver'],), ''), | |
916 ] | 911 ] |
917 self.assertEqual(git_cl.main(['patch', '123456']), 0) | 912 self.assertEqual(git_cl.main(['patch', '123456']), 0) |
918 | 913 |
919 def test_patch_conflict(self): | 914 def test_patch_conflict(self): |
920 self._patch_common() | 915 self._patch_common() |
921 self.calls += [ | 916 self.calls += [ |
922 ((['git', 'apply', '--index', '-p0', '--3way'],), '', | 917 ((['git', 'apply', '--index', '-p0', '--3way'],), '', |
923 subprocess2.CalledProcessError(1, '', '', '', '')), | 918 subprocess2.CalledProcessError(1, '', '', '', '')), |
924 ] | 919 ] |
925 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) | 920 self.assertNotEqual(git_cl.main(['patch', '123456']), 0) |
926 | 921 |
927 if __name__ == '__main__': | 922 if __name__ == '__main__': |
928 git_cl.logging.basicConfig( | 923 git_cl.logging.basicConfig( |
929 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) | 924 level=git_cl.logging.DEBUG if '-v' in sys.argv else git_cl.logging.ERROR) |
930 unittest.main() | 925 unittest.main() |
OLD | NEW |