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

Unified Diff: tests/git_cl_test.py

Issue 2117483002: Implement git cl upload -b BUG --bug=BUG. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: fix Created 4 years, 6 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 cc01ae3b829da5dbb5a2862a7a10aee44ade7886..ab59ca3ccbb34769783969697cf9bf1fb0f976ad 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -208,6 +208,16 @@ class TestGitClBasic(unittest.TestCase):
123, 4, 'chrome-review.source.com')
test('https://chrome-review.source.com/bad/123/4', fail=True)
+ def test_get_bug_line_values(self):
+ f = lambda p, bugs: list(git_cl._get_bug_line_values(p, bugs))
+ self.assertEqual(f('', ''), [])
+ self.assertEqual(f('', '123,v8:456'), ['123', 'v8:456'])
+ self.assertEqual(f('v8', '456'), ['v8:456'])
+ self.assertEqual(f('v8', 'chromium:123,456'), ['v8:456', 'chromium:123'])
+ # Not nice, but not worth carying.
+ self.assertEqual(f('v8', 'chromium:123,456,v8:123'),
+ ['v8:456', 'chromium:123', 'v8:123'])
+
class TestGitCl(TestCase):
def setUp(self):
@@ -688,6 +698,14 @@ class TestGitCl(TestCase):
self.assertEqual(
'Must specify reviewers to send email.\n', stderr.getvalue())
+ def test_bug_on_cmd(self):
+ self._run_reviewer_test(
+ ['--bug=500658,proj:123'],
+ 'desc\n\nBUG=500658\nBUG=proj:123',
+ '# Blah blah comment.\ndesc\n\nBUG=500658\nBUG=proj:1234',
+ 'desc\n\nBUG=500658\nBUG=proj:1234',
+ [])
+
def test_dcommit(self):
self.mock(git_cl.sys, 'stdout', StringIO.StringIO())
self.calls = (
« 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