| 207 | ('needs review', 2, 3)) |
| 208 | |
| 209 | def test_xrefs(self): |
| 210 | def expect(body, comments, result): |
| 211 | self.assertEqual(result, classifier.get_xrefs( |
| 212 | [{'comment': c} for c in comments], {'body': body})) |
| 213 | def fail(path): |
| 214 | return 'foobar https://gubernator.k8s.io/build%s asdf' % path |
| 215 | expect(None, [], []) |
| 216 | expect('something', [], []) |
| 217 | expect(fail('/a/b/34/'), [], ['/a/b/34']) |
| 218 | expect(None, [fail('/a/b/34/')], ['/a/b/34']) |
| 219 | expect(fail('/a/b/34/'), [fail('/a/b/34]')], ['/a/b/34']) |
| 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): |