return subject
-sig_re = re.compile('^(-{2,3} ?|_+)\n.*', re.S | re.M)
+sig_re = re.compile('^(-- |_+)\n.*', re.S | re.M)
def clean_content(str):
+ """ Try to remove signature (-- ) and list footer (_____) cruft """
str = sig_re.sub('', str)
return str.strip()
'-- \nsig\n' + self.orig_patch)
(self.patch, self.comment) = find_content(self.project, email)
+
+class ListFooterTest(InlinePatchTest):
+ patch_filename = '0001-add-line.patch'
+ test_comment = 'Test comment\nmore comment'
+
+ def setUp(self):
+ self.orig_patch = self.read_patch(self.patch_filename)
+ email = self.create_email( \
+ self.test_comment + '\n' + \
+ '_______________________________________________\n' + \
+ 'Linuxppc-dev mailing list\n' + \
+ self.orig_patch)
+ (self.patch, self.comment) = find_content(self.project, email)
+
+
+class UpdateCommentTest(InlinePatchTest):
+ """ Test for '---\nUpdate: v2' style comments to patches. """
+ patch_filename = '0001-add-line.patch'
+ test_comment = 'Test comment\nmore comment\n---\nUpdate: test update'
+
+class UpdateSigCommentTest(SignatureCommentTest):
+ """ Test for '---\nUpdate: v2' style comments to patches, with a sig """
+ patch_filename = '0001-add-line.patch'
+ test_comment = 'Test comment\nmore comment\n---\nUpdate: test update'