def setUp(self): self.config = reviewers.Config() self.config_file = tempfile.NamedTemporaryFile('w') self.mock_args = MagicMock() self.mock_args.verbose = None self.mock_args.ignore = '' self.mock_args.json = '' self.mock_args.copy = None
def test_verbose_reviewers(self, mock_print): config = reviewers.Config() config.verbose = True counter = Counter({'asdf': 1, 'qwer': 1}) get_reviewers = ('git_reviewers.reviewers.' 'FindFileLogReviewers.get_reviewers') run_command = 'git_reviewers.reviewers.FindReviewers.run_command' with patch.object(sys, 'argv', ['reviewers.py', '--verbose']): with patch(get_reviewers) as mock_get_reviewers: with patch(run_command) as mock_run_command: with patch('subprocess.Popen') as mock_popen: mock_popen().communicate.return_value = \ [PHAB_ACTIVATED_DATA, b''] mock_run_command.return_value = [] mock_get_reviewers.return_value = counter reviewers.get_reviewers(config) self.assertEqual(len(mock_print.call_args), 2) self.assertEqual( mock_print.call_args[0][0], 'Reviewers from FindArcCommitReviewers: %s' % "{'asdf': 1, 'qwer': 1}")
def setUp(self): self.finder = reviewers.FindFileLogReviewers(reviewers.Config())
def setUp(self): self.finder = reviewers.FindReviewers(reviewers.Config()) self.orig_reviewers_limit = reviewers.REVIEWERS_LIMIT
def setUp(self): self.finder = reviewers.FindArcCommitReviewers(reviewers.Config())
def setUp(self): self.finder = reviewers.FindHistoricalReviewers(reviewers.Config())
def setUp(self) -> None: self.finder = reviewers.FindLogReviewers(reviewers.Config())