예제 #1
0
 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
예제 #2
0
 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}")
예제 #3
0
 def setUp(self):
     self.finder = reviewers.FindFileLogReviewers(reviewers.Config())
예제 #4
0
 def setUp(self):
     self.finder = reviewers.FindReviewers(reviewers.Config())
     self.orig_reviewers_limit = reviewers.REVIEWERS_LIMIT
예제 #5
0
 def setUp(self):
     self.finder = reviewers.FindArcCommitReviewers(reviewers.Config())
예제 #6
0
 def setUp(self):
     self.finder = reviewers.FindHistoricalReviewers(reviewers.Config())
예제 #7
0
 def setUp(self) -> None:
     self.finder = reviewers.FindLogReviewers(reviewers.Config())