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

Unified Diff: tests/git_cl_test.py

Issue 2032433003: git cl issue 0 should really clear issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: fix Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_cl_test.py
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index 3924b22d948f89322c1a3af2d90858cc8a96db81..064520ca969d22282decd5a57e4554ec32941a18 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -1453,6 +1453,24 @@ class TestGitCl(TestCase):
self.assertEqual(0, git_cl.main(['description', '-n', '-']))
self.assertEqual('hi\n\t there\n\nman', ChangelistMock.desc)
+ def test_cmd_issue_erase_existing(self):
+ out = StringIO.StringIO()
+ self.mock(git_cl.sys, 'stdout', out)
+ self.calls = [
+ ((['git', 'symbolic-ref', 'HEAD'],), 'feature'),
+ ((['git', 'config', 'branch.feature.rietveldissue'],), ''),
+ ((['git', 'config', 'branch.feature.gerritissue'],), '123'),
+ ((['git', 'config', '--unset', 'branch.feature.gerritissue'],), ''),
+ ((['git', 'config', '--unset', 'branch.feature.gerritpatchset'],), ''),
+ # Let this command raise exception (retcode=1) - it should be ignored.
+ ((['git', 'config', '--unset', 'branch.feature.last-upload-hash'],),
+ '', subprocess2.CalledProcessError(1, '', '', '', '')),
+ ((['git', 'config', '--unset', 'branch.feature.gerritserver'],), ''),
+ ((['git', 'config', '--unset', 'branch.feature.gerritsquashhash'],),
+ ''),
+ ]
+ self.assertEqual(0, git_cl.main(['issue', '0']))
+
if __name__ == '__main__':
git_cl.logging.basicConfig(
« 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