← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:fix-resubmit-vote-name into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:fix-resubmit-vote-name into launchpad:master.

Commit message:
Fix VoteEmailCommand handler for new needs-resubmitting vote

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/399696

Leaving an alias behind for the old "resubmit" name of this vote seems polite.

See https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/399648.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-resubmit-vote-name into launchpad:master.
diff --git a/lib/lp/code/mail/codehandler.py b/lib/lp/code/mail/codehandler.py
index 15f288e..508fb46 100644
--- a/lib/lp/code/mail/codehandler.py
+++ b/lib/lp/code/mail/codehandler.py
@@ -103,6 +103,9 @@ class VoteEmailCommand(CodeReviewEmailCommand):
         'needsinformation': CodeReviewVote.NEEDS_INFO,
         'needs_information': CodeReviewVote.NEEDS_INFO,
         'needs-information': CodeReviewVote.NEEDS_INFO,
+        'needsresubmitting': CodeReviewVote.NEEDS_RESUBMITTING,
+        'needs-resubmitting': CodeReviewVote.NEEDS_RESUBMITTING,
+        'resubmit': CodeReviewVote.NEEDS_RESUBMITTING,
         }
 
     def execute(self, context):
diff --git a/lib/lp/code/mail/tests/test_codehandler.py b/lib/lp/code/mail/tests/test_codehandler.py
index 197ee49..47dc486 100644
--- a/lib/lp/code/mail/tests/test_codehandler.py
+++ b/lib/lp/code/mail/tests/test_codehandler.py
@@ -229,7 +229,7 @@ class TestCodeHandler(TestCaseWithFactory):
         Error message:
 
         The 'review' command expects any of the following arguments:
-        abstain, approve, disapprove, needs-fixing, needs-info, resubmit
+        abstain, approve, disapprove, needs-fixing, needs-info, needs-resubmitting
 
         For example:
 
@@ -540,6 +540,17 @@ class TestVoteEmailCommand(TestCase):
         command = VoteEmailCommand('vote', ['needs-information'])
         self.assertVoteAndTag(CodeReviewVote.NEEDS_INFO, None, command)
 
+    def test_getVoteNeedsResubmittingAlias(self):
+        """Test the needs_resubmitting review type and its aliases."""
+        command = VoteEmailCommand('vote', ['needs_resubmitting'])
+        self.assertVoteAndTag(CodeReviewVote.NEEDS_RESUBMITTING, None, command)
+        command = VoteEmailCommand('vote', ['needsresubmitting'])
+        self.assertVoteAndTag(CodeReviewVote.NEEDS_RESUBMITTING, None, command)
+        command = VoteEmailCommand('vote', ['needs-resubmitting'])
+        self.assertVoteAndTag(CodeReviewVote.NEEDS_RESUBMITTING, None, command)
+        command = VoteEmailCommand('vote', ['resubmit'])
+        self.assertVoteAndTag(CodeReviewVote.NEEDS_RESUBMITTING, None, command)
+
 
 class TestUpdateStatusEmailCommand(TestCaseWithFactory):
     """Test the UpdateStatusEmailCommand."""