def test_basic(self): expected_stdout = "REVIEWER: Xianzhu Wang ([email protected]) has 88 reviewed patches\n" options = self._make_options() suggest_nominations = SuggestNominations() suggest_nominations._init_options(options=options) suggest_nominations._recent_commit_messages = lambda: [self.mock_non_committer_commit_message for _ in range(88)] self.assert_execute_outputs(suggest_nominations, [], expected_stdout=expected_stdout, options=options)
def test_recent_commit_messages(self): tool = MockTool() suggest_nominations = SuggestNominations() suggest_nominations._init_options(options=self._make_options()) suggest_nominations.bind_to_tool(tool) tool.executive.run_command = lambda command: self.mock_git_output self.assertEqual(list(suggest_nominations._recent_commit_messages()), [self.mock_same_author_commit_message])
def test_basic(self): expected_stdout = "REVIEWER: Xianzhu Wang ([email protected]) has 88 reviewed patches\n" options = self._make_options() suggest_nominations = SuggestNominations() suggest_nominations._init_options(options=options) suggest_nominations._recent_commit_messages = lambda: [ self.mock_non_committer_commit_message for _ in range(88) ] self.assert_execute_outputs(suggest_nominations, [], expected_stdout=expected_stdout, options=options)
def test_with_verbose(self): expected_stdout = "COMMITTER: Xianzhu Wang ([email protected]) has 88 reviewed patches\nCONTRIBUTOR: Xianzhu Wang ([email protected]) has 88 reviewed patches\n" options = self._make_options(verbose=True) suggest_nominations = SuggestNominations() suggest_nominations._init_options(options=options) suggest_nominations._recent_commit_messages = lambda: [ self.mock_non_committer_commit_message for _ in range(88) ] self.assert_execute_outputs(suggest_nominations, [], expected_stdout=expected_stdout, options=options)
def test_recent_commit_messages(self): tool = MockTool() suggest_nominations = SuggestNominations() suggest_nominations._init_options( options=MockOptions( reviewer_minimum=80, committer_minimum=10, max_commit_age=9, show_commits=False, verbose=False ) ) suggest_nominations.bind_to_tool(tool) tool.executive.run_command = lambda command: self.mock_git_output self.assertEqual(list(suggest_nominations._recent_commit_messages()), [self.mock_same_author_commit_message])
def test_recent_commit_messages(self): tool = MockTool() suggest_nominations = SuggestNominations() suggest_nominations._init_options( options=MockOptions(reviewer_minimum=80, committer_minimum=10, max_commit_age=9, show_commits=False, verbose=False)) suggest_nominations.bind_to_tool(tool) tool.executive.run_command = lambda command: self.mock_git_output self.assertEqual(list(suggest_nominations._recent_commit_messages()), [self.mock_same_author_commit_message])
def test_basic(self): expected_stdout = "COMMITTER AND REVIEWER: Xianzhu Wang ([email protected]) has 88 reviewed patches\n" suggest_nominations = SuggestNominations() suggest_nominations._init_options( options=MockOptions( reviewer_minimum=80, committer_minimum=10, max_commit_age=9, show_commits=False, verbose=False ) ) suggest_nominations._recent_commit_messages = lambda: [ self.mock_non_committer_commit_message for _ in range(88) ] self.assert_execute_outputs( suggest_nominations, [], expected_stdout=expected_stdout, options=MockOptions( reviewer_minimum=80, committer_minimum=10, max_commit_age=9, show_commits=False, verbose=False ), )
def test_basic(self): expected_stdout = "REVIEWER: Xianzhu Wang ([email protected]) has 88 reviewed patches\n" suggest_nominations = SuggestNominations() suggest_nominations._init_options( options=MockOptions(reviewer_minimum=80, committer_minimum=10, max_commit_age=9, show_commits=False, verbose=False)) suggest_nominations._recent_commit_messages = lambda: [ self.mock_non_committer_commit_message for _ in range(88) ] self.assert_execute_outputs(suggest_nominations, [], expected_stdout=expected_stdout, options=MockOptions(reviewer_minimum=80, committer_minimum=10, max_commit_age=9, show_commits=False, verbose=False))