]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/tests/patchparser.py
parser: Allow pull requests to include a diff
[patchwork] / apps / patchwork / tests / patchparser.py
index 953b94cfca8f23701541d8f46a85de29bd99e4a0..7013e851f835bf0130be661c06e908962b33d331 100644 (file)
@@ -360,3 +360,16 @@ class GitPullTest(PatchTest):
 
 class GitPullWrappedTest(GitPullTest):
     mail_file = '0002-git-pull-request-wrapped.mbox'
+
+class GitPullWithDiffTest(PatchTest):
+    def testGitPullWithDiff(self):
+        mail = read_mail('0003-git-pull-request-with-diff.mbox',
+                        project = self.project)
+        (patch, comment) = find_content(self.project, mail)
+        self.assertTrue(patch is not None)
+        self.assertEqual('git://git.kernel.org/pub/scm/linux/kernel/git/tip/' +
+             'linux-2.6-tip.git x86-fixes-for-linus', patch.pull_url)
+        self.assertTrue(
+            patch.content.startswith('diff --git a/arch/x86/include/asm/smp.h'),
+            patch.content)
+        self.assertTrue(comment is not None)