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

Unified Diff: tests/git_cl_test.py

Issue 2141283002: Fix git cl set-commit --clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: fix Created 4 years, 5 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 c500b815323a9ceb0dec3205af4faf258237564d..9596653b65068309f02a4697b965b2901d364f2c 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -1480,7 +1480,7 @@ class TestGitCl(TestCase):
]
self.assertEqual(0, git_cl.main(['set-commit']))
- def test_cmd_set_commit_gerrit(self):
+ def _cmd_set_commit_gerrit_common(self, vote):
self.mock(git_cl.gerrit_util, 'SetReview',
lambda h, i, labels: self._mocked_call(
['SetReview', h, i, labels]))
@@ -1491,13 +1491,21 @@ class TestGitCl(TestCase):
((['git', 'config', 'branch.feature.gerritserver'],),
'https://chromium-review.googlesource.com'),
((['SetReview', 'chromium-review.googlesource.com', 123,
- {'Commit-Queue': 1}],), ''),
+ {'Commit-Queue': vote}],), ''),
]
- # TODO(tandrii): consider testing just set-commit and set-commit --clear,
- # but without copy-pasting tons of expectations, as modifying them later is
- # super tedious.
+
+ def test_cmd_set_commit_gerrit_clear(self):
+ self._cmd_set_commit_gerrit_common(0)
+ self.assertEqual(0, git_cl.main(['set-commit', '-c']))
+
+ def test_cmd_set_commit_gerrit_dry(self):
+ self._cmd_set_commit_gerrit_common(1)
self.assertEqual(0, git_cl.main(['set-commit', '-d']))
+ def test_cmd_set_commit_gerrit(self):
+ self._cmd_set_commit_gerrit_common(2)
+ self.assertEqual(0, git_cl.main(['set-commit']))
+
def test_description_display(self):
out = StringIO.StringIO()
self.mock(git_cl.sys, 'stdout', out)
« 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