Skip to content

Commit

Permalink
Testing behavior when global config contains already-defined groups
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalber committed Feb 23, 2018
1 parent 73a72a1 commit f743b3a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion highfive/tests/test_newpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def setUpClass(cls):
"groups": {
"core": ["@alexcrichton"],
}
}
},
'has_all': {
"groups": { "all": ["@alexcrichton"] }
},
}

def choose_reviewer(
Expand Down Expand Up @@ -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.
"""
Expand Down

0 comments on commit f743b3a

Please sign in to comment.