Show More
@@ -1137,7 +1137,7 b' def urlify_issues(newtext, repo_name):' | |||
|
1137 | 1137 | issue_pat = CONFIG.get(k) |
|
1138 | 1138 | issue_server_link = CONFIG.get('issue_server_link%s' % suffix) |
|
1139 | 1139 | issue_prefix = CONFIG.get('issue_prefix%s' % suffix) |
|
1140 | if issue_pat and issue_server_link and issue_prefix: | |
|
1140 | if issue_pat and issue_server_link and issue_prefix is not None: # issue_prefix can be empty but should be present | |
|
1141 | 1141 | log.debug('issue pattern %r: %r -> %r %r', suffix, issue_pat, issue_server_link, issue_prefix) |
|
1142 | 1142 | else: |
|
1143 | 1143 | log.error('skipping incomplete issue pattern %r: %r -> %r %r', suffix, issue_pat, issue_server_link, issue_prefix) |
@@ -415,7 +415,7 b' class TestLibs(TestController):' | |||
|
415 | 415 | (r'BUG(\d{5})', 'https://bar/{repo}/', 'BUG', |
|
416 | 416 | 'silly me, the URL does not contain {id}, BUG12345.', 'silly me, the URL does not contain {id}, <a class="issue-tracker-link" href="https://bar/repo_name/">BUG12345</a>.'), |
|
417 | 417 | (r'(PR-\d+)', 'http://foo/{repo}/issue/{id}', '', |
|
418 |
'interesting issue #123, err PR-56', 'interesting issue #123, err PR-56'), |
|
|
418 | 'interesting issue #123, err PR-56', 'interesting issue #123, err <a class="issue-tracker-link" href="http://foo/repo_name/issue/PR-56">PR-56</a>'), | |
|
419 | 419 | ]) |
|
420 | 420 | def test_urlify_issues(self, issue_pat, issue_server, issue_prefix, sample, expected): |
|
421 | 421 | from kallithea.lib.helpers import urlify_issues |
@@ -436,7 +436,7 b' class TestLibs(TestController):' | |||
|
436 | 436 | ('pull request7 #', '<a class="issue-tracker-link" href="http://pr/repo_name/pr/7">PR#7</a> #'), |
|
437 | 437 | ('look PR9 and pr #11', 'look <a class="issue-tracker-link" href="http://pr/repo_name/pr/9">PR#9</a> and <a class="issue-tracker-link" href="http://pr/repo_name/pr/11">PR#11</a>'), |
|
438 | 438 | ('pullrequest#10 solves issue 9', '<a class="issue-tracker-link" href="http://pr/repo_name/pr/10">PR#10</a> solves <a class="issue-tracker-link" href="http://bug/repo_name/bug/9">bug#9</a>'), |
|
439 | ('issue FAIL67', 'issue FAIL67'), # no match because empty prefix | |
|
439 | ('issue FAIL67', 'issue <a class="issue-tracker-link" href="http://fail/repo_name/67">67</a>'), | |
|
440 | 440 | ('issue FAILMORE89', 'issue FAILMORE89'), # no match because absent prefix |
|
441 | 441 | ]) |
|
442 | 442 | def test_urlify_issues_multiple_issue_patterns(self, sample, expected): |
General Comments 0
You need to be logged in to leave comments.
Login now