Allow forward slashes (/) in commit email tags in be-handle-mail.
authorW. Trevor King <wking@drexel.edu>
Tue, 19 Jan 2010 15:37:31 +0000 (10:37 -0500)
committerW. Trevor King <wking@drexel.edu>
Tue, 19 Jan 2010 15:37:31 +0000 (10:37 -0500)
Also move unitsuite definition to the end of the file so it picks up
GenerateGlobalTagsTestCase.

interfaces/email/interactive/be-handle-mail

index 161e11825d922064285edbef5449e03e853aed2b..036caa02f2488bbb1a6b67417f631c40761b7a1c 100755 (executable)
@@ -693,7 +693,7 @@ def generate_global_tags(tag_base=u'be-bug'):
     SUBJECT_TAG_START = u'[%s' % tag_base
     SUBJECT_TAG_RESPONSE = u'[%s]' % tag_base
     SUBJECT_TAG_NEW = u'[%s:submit]' % tag_base
-    SUBJECT_TAG_COMMENT = re.compile(u'\[%s:([\-0-9a-z]*)]' % tag_base)
+    SUBJECT_TAG_COMMENT = re.compile(u'\[%s:([\-0-9a-z/]*)]' % tag_base)
     SUBJECT_TAG_CONTROL = SUBJECT_TAG_RESPONSE
 
 def open_logfile(logpath=None):
@@ -724,9 +724,6 @@ def close_logfile():
     if LOGFILE != None and LOGPATH not in [u'stderr', u'none']:
         LOGFILE.close()
 
-unitsuite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
-suite = unittest.TestSuite([unitsuite, doctest.DocTestSuite()])
-
 def test():
     result = unittest.TextTestRunner(verbosity=2).run(suite)
     num_errors = len(result.errors)
@@ -900,9 +897,12 @@ class GenerateGlobalTagsTestCase (unittest.TestCase):
     def test_subject_tag_comment(self):
         "Should set SUBJECT_TAG_COMMENT global correctly"
         generate_global_tags(u'projectX-bug')
-        m = SUBJECT_TAG_COMMENT.match('[projectX-bug:xyz-123]')
+        m = SUBJECT_TAG_COMMENT.match('[projectX-bug:abc/xyz-123]')
         self.failUnlessEqual(len(m.groups()), 1)
-        self.failUnlessEqual(m.group(1), u'xyz-123')
+        self.failUnlessEqual(m.group(1), u'abc/xyz-123')
+
+unitsuite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
+suite = unittest.TestSuite([unitsuite, doctest.DocTestSuite()])
 
 if __name__ == "__main__":
     main(sys.argv)