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

Unified Diff: tests/git_cl_test.py

Issue 2252043002: Gerrit git cl upload: auto-filter patchset titles. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: 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
« git_cl.py ('K') | « 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 a8c4944f64587dc5bb877fdc08b0548c38947018..f4aa79838bfdd5902fba228677022e39af8856c1 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -974,13 +974,18 @@ class TestGitCl(TestCase):
squash=False,
squash_mode='override_nosquash')
- def test_gerrit_patch_title(self):
+ def test_gerrit_patch_bad_chars(self):
+ self.mock(git_cl.sys, 'stdout', StringIO.StringIO())
self._run_gerrit_upload_test(
- ['-t', 'Don\'t put under_scores as they become spaces'],
+ ['-f', '-t', 'Don\'t put bad cha,.rs'],
'desc\n\nBUG=\n\nChange-Id: I123456789',
squash=False,
squash_mode='override_nosquash',
- ref_suffix='%m=Don\'t_put_under_scores_as_they_become_spaces')
+ ref_suffix='%m=Dont_put_bad_chars')
+ self.assertIn(
+ 'WARNING: Patchset title may only contain alphanumeric chars and '
+ 'space. Cleaned up title:\nDont put bad chars\n',
Bons 2016/08/17 16:48:18 and spaces.
+ git_cl.sys.stdout.getvalue())
def test_gerrit_reviewers_cmd_line(self):
self._run_gerrit_upload_test(
« git_cl.py ('K') | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698