MCPcopy
hub / github.com/kubernetes/test-infra / test_reviewers

Method test_reviewers

gubernator/github/classifier_test.py:222–241  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

220 expect(fail('/a/b/34/)'), [fail('/a/b/35]')], ['/a/b/34', '/a/b/35'])
221
222 def test_reviewers(self):
223 def expect(events, result):
224 self.assertEqual(result, classifier.get_reviewers(events))
225
226 def mk(*specs):
227 out = []
228 for event, action, body in specs:
229 body = dict(body) # copy
230 body['action'] = action
231 out.append((event, body, 0))
232 return out
233
234 expect([], set())
235
236 user_a = {'requested_reviewer': {'login': 'a'}}
237 expect(mk(('pull_request', 'review_requested', user_a)), {'a'})
238 expect(mk(('pull_request', 'review_request_removed', user_a)), set())
239 expect(mk(('pull_request', 'review_requested', user_a),
240 ('pull_request', 'review_request_removed', user_a)), set())
241 expect(mk(('pull_request_review', 'submitted', {'sender': {'login': 'a'}})), {'a'})
242
243 def test_approvers(self):
244 def expect(comment, result):

Callers

nothing calls this directly

Calls 1

expectFunction · 0.50

Tested by

no test coverage detected