예제 #1
0
 def test_getVoteAbstainAlias(self):
     """Test the abstain alias of 0."""
     command = VoteEmailCommand('vote', ['0'])
     self.assertVoteAndTag(CodeReviewVote.ABSTAIN, None, command)
     command = VoteEmailCommand('vote', ['+0'])
     self.assertVoteAndTag(CodeReviewVote.ABSTAIN, None, command)
     command = VoteEmailCommand('vote', ['-0'])
     self.assertVoteAndTag(CodeReviewVote.ABSTAIN, None, command)
예제 #2
0
 def test_getVoteNeedsFixingAlias(self):
     """Test the needs_fixing aliases of needsfixing and needs-fixing."""
     command = VoteEmailCommand('vote', ['needs_fixing'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_FIXING, None, command)
     command = VoteEmailCommand('vote', ['needsfixing'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_FIXING, None, command)
     command = VoteEmailCommand('vote', ['needs-fixing'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_FIXING, None, command)
예제 #3
0
 def test_getVoteNeedsInfoAlias(self):
     """Test the needs_info review type and its aliases."""
     command = VoteEmailCommand('vote', ['needs_info'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_INFO, None, command)
     command = VoteEmailCommand('vote', ['needsinfo'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_INFO, None, command)
     command = VoteEmailCommand('vote', ['needs-info'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_INFO, None, command)
     command = VoteEmailCommand('vote', ['needs_information'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_INFO, None, command)
     command = VoteEmailCommand('vote', ['needsinformation'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_INFO, None, command)
     command = VoteEmailCommand('vote', ['needs-information'])
     self.assertVoteAndTag(CodeReviewVote.NEEDS_INFO, None, command)
예제 #4
0
 def test_getVoteDisapproveAlias(self):
     """Test the disapprove alias of -1."""
     command = VoteEmailCommand('vote', ['-1'])
     self.assertVoteAndTag(CodeReviewVote.DISAPPROVE, None, command)
예제 #5
0
 def test_getVoteApproveAlias(self):
     """Test the approve alias of +1."""
     command = VoteEmailCommand('vote', ['+1'])
     self.assertVoteAndTag(CodeReviewVote.APPROVE, None, command)
예제 #6
0
 def test_getVoteThreeArg(self):
     """getVote returns vote, vote_tag when both are supplied."""
     command = VoteEmailCommand('vote', ['apPRoVe', 'DB', 'TAG'])
     self.assertVoteAndTag(CodeReviewVote.APPROVE, 'DB TAG', command)
예제 #7
0
 def test_getVoteBadValue(self):
     """getVote returns vote, None when only a vote is supplied."""
     command = VoteEmailCommand('vote', ['badvalue'])
     self.assertRaises(EmailProcessingError, command.execute, self.context)
예제 #8
0
 def test_getVoteDisapprove(self):
     """getVote returns disapprove when it is specified."""
     command = VoteEmailCommand('vote', ['dIsAppRoVe'])
     self.assertVoteAndTag(CodeReviewVote.DISAPPROVE, None, command)
예제 #9
0
 def test_getVoteOneArg(self):
     """getVote returns vote, None when only a vote is supplied."""
     command = VoteEmailCommand('vote', ['apPRoVe'])
     self.assertVoteAndTag(CodeReviewVote.APPROVE, None, command)
예제 #10
0
 def test_getVoteNoArgs(self):
     """getVote returns None, None when no arguments are supplied."""
     command = VoteEmailCommand('vote', [])
     self.assertRaises(EmailProcessingError, command.execute, self.context)