|
7 | 7 | import cla |
8 | 8 | from cla import utils |
9 | 9 | from cla.models.dynamo_models import Project, Signature, User |
10 | | -from cla.utils import (append_email_help_sign_off_content, |
| 10 | +from cla.utils import (append_email_help_sign_off_content, extract_pull_request_number, |
11 | 11 | append_project_version_to_url, get_email_help_content, |
12 | 12 | get_email_sign_off_content, get_full_sign_url) |
13 | 13 |
|
@@ -283,3 +283,32 @@ def test_append_project_version_to_url(): |
283 | 283 |
|
284 | 284 | if __name__ == '__main__': |
285 | 285 | unittest.main() |
| 286 | + |
| 287 | +def test_extract_pull_request_number(): |
| 288 | + tests = [ |
| 289 | + ["Merge pull request #232 from sun-test-org/thakurveerendras-patch-26#1\n\nUpdate README.md", 232], |
| 290 | + ["Merge pull request #234 from sun-test-org/thakurveerendras-patch-26\n\nCreate mqfile2#file2", 234], |
| 291 | + ["Merge pull request #235 from sun-test-org/branch#2341\n\nMQFileBranch#2342", 235], |
| 292 | + ["Merge pull request #236 from sun-test-org/thakurveerendras-patch-27\n\nUpdate mqfile2#234", 236], |
| 293 | + ["Merge pull request #237 from sun-test-org/thakurveerendras-patch-28#123\n\nCreate mqfile3#123", 237], |
| 294 | + ["Merge pull request #235 from sun-test-org/branch#2341\n\nMQFileBranch#2342", 235], |
| 295 | + ["Merge pull request #238 from sun-test-org/branch#23456\n\nPR#234567", 238], |
| 296 | + ["Merge pull request #235 from sun-test-org/branch#2341\n\nMQFileBranch#2342", 235], |
| 297 | + ["merge pull request #235 from sun-test-org/branch#2341\n\nMQFileBranch#2342", 235], |
| 298 | + ["Hello world\nThis if for PR #123 fixing issue #112", 123], |
| 299 | + # ["Hello world\nThis if for Issue #112 - PR #123", 123], |
| 300 | + ["[mdatagen] Add event type definition (#12822)\n\n#Description\n\nHello, ...", 12822], |
| 301 | + ["[pt] Update localized content on content/pt/docs/languages/go/exporters.md (#6783)", 6783], |
| 302 | + [ "[chore]: remove testifylint-fix target (#12828)\n\n#### Description\n\ngolangci-lint is now able to apply suggested fixes from testifylint with\ngolangci-lint --fix .\nThis PR removes testifylint-fix target from Makefile.\n\nSigned-off-by: Matthieu MOREL <[email protected]>", 12828], |
| 303 | + [ "[chore] Prepare release 0.125.0 (#933)\n\n* Update version from 0.124.0 to 0.125.0\n\n* update versions in ebpf\n\n---------\n\nCo-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>\nCo-authored-by: Yang Song <[email protected]>", 933], |
| 304 | + ["Add invoke_agent as a member of gen_ai.operation.name (#2160)", 2160], |
| 305 | + ["Merge pull request #61 from open-telemetry/renovate/all-patch\n\nfix(deps): update all patch versions", 61], |
| 306 | + ["Merge pull request #51 from open-telemetry/rollback-deps\n\nchore: roll back major dependency updates", 51], |
| 307 | + ["fixes #6549 incorrect use of resource constructor (#6707)", 6707], |
| 308 | + ["", None], |
| 309 | + ["Add documentation example for xconfmap (#5675) (#12832)\n#### Description\n\nThis PR introduces a simple testable examples to the package\n[confmap](/confmap/xconfmap)", 12832] |
| 310 | + ] |
| 311 | + |
| 312 | + for i, (message, expected) in enumerate(tests, 1): |
| 313 | + result = extract_pull_request_number(message) |
| 314 | + assert result == expected |
0 commit comments