diff --git a/highfive/tests/test_newpr.py b/highfive/tests/test_newpr.py index 217d284..8b4edb4 100644 --- a/highfive/tests/test_newpr.py +++ b/highfive/tests/test_newpr.py @@ -49,7 +49,10 @@ def setUpClass(cls): "groups": { "core": ["@alexcrichton"], } - } + }, + 'has_all': { + "groups": { "all": ["@alexcrichton"] } + }, } def choose_reviewer( @@ -165,6 +168,18 @@ def test_global_core(self): self.assertEqual(set(['alexcrichton']), chosen_reviewers) self.assertEqual(set([()]), mentions) + @mock.patch('highfive.newpr._load_json_file') + def test_global_group_overlap(self, mock_load_json): + """Test for an AssertionError when the global config contains a group + already defined in the config. + """ + mock_load_json.return_value = self.global_['has_all'] + self.assertRaises( + AssertionError, newpr.choose_reviewer, 'rust', 'rust-lang', + self.diff['normal'], 'fooauthor', + self.config['individuals_no_dirs'] + ) + def test_no_potential_reviewers(self): """Test choosing a reviewer when nobody qualifies. """