Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/hg/test/update_issues.py

Issue 29344546: Issue 4070 - Correctly handle multiline commit messages in the mercurial hook (Closed)
Patch Set: Created May 25, 2016, 5:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/hg/test/update_issues.py
===================================================================
--- a/sitescripts/hg/test/update_issues.py
+++ b/sitescripts/hg/test/update_issues.py
@@ -134,16 +134,27 @@
def test_noissue_commits_ignored(self):
self._run_hook(['Noissue - Foo', 'noissue - Bar']) # No updates.
def test_single_issue_referenced(self):
updates = self._run_hook(['Issue 1337 - Foo'], update_count=1)
self.assertEqual(updates[0][0][0], 1337)
+ def test_multiline_commit_message(self):
+ updates = self._run_hook(['Issue 1337 - Foo\nBar',
+ 'Issue 1337 - Bar.\nBaz',
+ 'Fixes 2448 - Foo\n\nBar'],
+ update_count=2)
+ comment_1337 = updates[0][0][1]
+ self.assertIn('Issue 1337 - Foo...]', comment_1337)
+ self.assertIn('Issue 1337 - Bar...]', comment_1337)
+ comment_2448 = updates[1][0][1]
+ self.assertIn('Fixes 2448 - Foo]', comment_2448)
+
def test_missing_issue_referenced(self):
self._run_hook(['Issue 42 - Bar'], warning_count=1)
def test_multiple_issues_referenced(self):
updates = self._run_hook(['Issue 1337, fixes 2448 - Foo'],
update_count=2)
self.assertEqual(updates[0][0][0], 1337)
self.assertEqual(updates[1][0][0], 2448)
« sitescripts/hg/bin/update_issues.py ('K') | « sitescripts/hg/template/issue_commit_comment.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld