Ezio Melotti added the comment:

Attached a patch that adds support for fix/fixes/fixed.
In order to test this we would currently need to create a file for each 
variation, so I just tested directly against the regex.  For the future, it 
would be better to add to the tests a way to dynamically create files, but 
that's a separate issue.

----------
nosy: +ezio.melotti, maciej.szulik
status: unread -> in-progress

_______________________________________________________
PSF Meta Tracker <metatrac...@psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue627>
_______________________________________________________
diff --git a/roundup/github.py b/roundup/github.py
--- a/roundup/github.py
+++ b/roundup/github.py
@@ -16,7 +16,7 @@
         return a == b
 
 URL_RE = re.compile(r'https://github.com/python/cpython/pull/(?P<number>\d+)')
-VERBS = r'(?:\b(?P<verb>close[sd]?|closing|)\s+)?'
+VERBS = r'(?:\b(?P<verb>close[sd]?|closing|fix(?:e[sd])?|)\s+)?'
 ISSUE_RE = re.compile(r'%sbpo-(?P<issue_id>\d+)' % VERBS, re.I|re.U)
 BRANCH_RE = re.compile(r'(2\.\d|3\.\d|master)', re.I)
 
diff --git a/test/test_github.py b/test/test_github.py
--- a/test/test_github.py
+++ b/test/test_github.py
@@ -7,7 +7,7 @@
 from roundup.cgi import client
 from roundup.backends import list_backends
 from roundup.date import Date
-from roundup.github import GitHubHandler
+from roundup.github import GitHubHandler, ISSUE_RE
 from roundup.exceptions import *
 
 NEEDS_INSTANCE = 1
@@ -53,6 +53,18 @@
         self.db.issue.create(title="Issue 1")
         return dummy_client
 
+
+    def testVERBS(self):
+        """Check that all these messages contain a "closing verb"."""
+        messages = [
+            'close bpo-1', 'closes bpo-1', 'closed bpo-1', 'closing bpo-1',
+            'fix bpo-1', 'fixes bpo-1', 'fixed bpo-1',
+        ]
+        for message in messages:
+            for match in ISSUE_RE.finditer(message):
+                data = match.groupdict()
+                self.assertTrue(data.get('verb'))
+
     def testMissingSecretKey(self):
         os.environ.pop('SECRET_KEY')
         dummy_client = self._make_client("pingevent.txt")
_______________________________________________
Tracker-discuss mailing list
Tracker-discuss@python.org
https://mail.python.org/mailman/listinfo/tracker-discuss
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to