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

Unified Diff: tests/git_cl_test.py

Issue 2280563003: Fix Gerrit git cl land and add test. (Closed)
Patch Set: Fix code and finish test. Created 4 years, 4 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 47eaaf7eb32b919d583dcfa1c98709f5f6ac1531..9796b2bcb39430896f1985deba111aa3dd13f0e6 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -1894,6 +1894,23 @@ class TestGitCl(TestCase):
]
cl._codereview_impl._GerritCommitMsgHookCheck(offer_removal=True)
+ def test_GerritCmdLand(self):
+ self.calls += [
+ ((['git', 'symbolic-ref', 'HEAD'],), 'feature'),
+ ((['git', 'config', 'branch.feature.gerritsquashhash'],),
+ 'deadbeaf'),
+ ((['git', 'diff', 'deadbeaf'],), ''), # No diff.
+ ((['git', 'config', 'branch.feature.gerritserver'],),
+ 'chromium-review.googlesource.com'),
+ ]
+ cl = git_cl.Changelist(issue=123, codereview='gerrit')
+ cl._codereview_impl._GetChangeDetail = lambda _: {
+ 'labels': {},
+ 'current_revision': 'deadbeaf',
+ }
+ cl._codereview_impl.SubmitIssue = lambda wait_for_merge: None
+ self.assertEqual(0, cl.CMDLand(force=True, bypass_hooks=True, verbose=True))
+
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