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

Method test_approvers

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

Source from the content-addressed store, hash-verified

241 expect(mk(('pull_request_review', 'submitted', {'sender': {'login': 'a'}})), {'a'})
242
243 def test_approvers(self):
244 def expect(comment, result):
245 self.assertEqual(result, classifier.get_approvers([{
246 'author': 'k8s-merge-robot', 'comment': comment}]))
247
248 expect('nothing', [])
249 expect('before\n<!-- META={approvers:[someone]} -->', ['someone'])
250 expect('<!-- META={approvers:[someone,else]} -->', ['someone', 'else'])
251 expect('<!-- META={approvers:[someone,else]} -->', ['someone', 'else'])
252
253 # The META format is *supposed* to be JSON, but a recent change broke it.
254 # Support both formats so it can be fixed in the future.
255 expect('<!-- META={"approvers":["username"]} -->\n', ['username'])
256
257
258class CommentsTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

expectFunction · 0.50

Tested by

no test coverage detected