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

Unified Diff: tests/git_cl_test.py

Issue 1886433003: Gerrit git cl upload: implement patchset title (message). (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@R300
Patch Set: revision, as list suits better for repeated fields Created 4 years, 8 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 eca9cf4fb8266c0450b3cb2d1253a10f9dcacc68..cbeec08abbbed8b769c99e7230d45b97a0b6d408 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -738,6 +738,7 @@ class TestGitCl(TestCase):
@classmethod
def _gerrit_upload_calls(cls, description, reviewers, squash,
expected_upstream_ref='origin/refs/heads/master',
+ ref_suffix='',
post_amend_description=None, issue=None):
if post_amend_description is None:
post_amend_description = description
@@ -810,7 +811,7 @@ class TestGitCl(TestCase):
calls += [
((['git',
'push', receive_pack, 'origin',
- ref_to_push + ':refs/for/refs/heads/master'],),
+ ref_to_push + ':refs/for/refs/heads/master' + ref_suffix],),
('remote:\n'
'remote: Processing changes: (\)\n'
'remote: Processing changes: (|)\n'
@@ -840,18 +841,21 @@ class TestGitCl(TestCase):
self,
upload_args,
description,
- reviewers,
+ reviewers=None,
squash=False,
expected_upstream_ref='origin/refs/heads/master',
+ ref_suffix='',
post_amend_description=None,
issue=None):
"""Generic gerrit upload test framework."""
+ reviewers = reviewers or []
self.mock(git_cl.gerrit_util, "CookiesAuthenticator",
CookiesAuthenticatorMockFactory(same_cookie='same_cred'))
self.calls = self._gerrit_base_calls(issue=issue)
self.calls += self._gerrit_upload_calls(
description, reviewers, squash,
expected_upstream_ref=expected_upstream_ref,
+ ref_suffix=ref_suffix,
post_amend_description=post_amend_description,
issue=issue)
# Uncomment when debugging.
@@ -872,6 +876,12 @@ class TestGitCl(TestCase):
'desc\n\nBUG=\n\nChange-Id: I123456789\n',
[])
+ def test_gerrit_patch_title(self):
+ self._run_gerrit_upload_test(
+ ['-t', 'Don\'t put under_scores as they become spaces'],
+ 'desc\n\nBUG=\n\nChange-Id: I123456789',
+ ref_suffix='%m=Don\'t_put_under_scores_as_they_become_spaces')
+
def test_gerrit_reviewers_cmd_line(self):
self._run_gerrit_upload_test(
['-r', 'foo@example.com'],
« 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