]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/tests/patchparser.py
[parser] Don't remove --- update lines
[patchwork] / apps / patchwork / tests / patchparser.py
index 19b7aea2cc90cff1aaa3a2034ce5f52f9802d216..2e207bf7e9ec781a1ebb88f3b2b99146e86d503f 100644 (file)
@@ -89,3 +89,40 @@ class AttachmentPatchTest(InlinePatchTest):
         attachment = MIMEText(self.orig_patch, _subtype = 'x-patch')
         email.attach(attachment)
         (self.patch, self.comment) = find_content(self.project, email)
+
+
+class SignatureCommentTest(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' + \
+                '-- \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'