def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email(self.test_comment + '\n' + self.orig_patch) content = find_content(self.project, email) self.patch = content.patch self.comment = content.comment self.filenames = content.filenames
def setUp(self): email = create_email(self.orig_content + '\n' + self.orig_diff) del email['Content-Type'] del email['Content-Transfer-Encoding'] self.project = create_project() self.diff, self.content = find_content(self.project, email)
def setUp(self): self.orig_patch = read_patch(self.patch_filename, self.patch_encoding) email = create_email(self.test_comment + '\n' + self.orig_patch, content_encoding=self.patch_encoding) content = find_content(self.project, email) self.patch = content.patch self.comment = content.comment
def setUp(self): msg = MIMEText(self.orig_content + '\n' + self.orig_diff, _charset='utf-8') email = _create_email(msg) self.project = create_project() self.diff, self.content = find_content(self.project, email)
def setUp(self): self.orig_patch = read_patch(self.patch_filename, self.patch_encoding) email = create_email(self.test_comment + '\n' + self.orig_patch, content_encoding = self.patch_encoding) content = find_content(self.project, email) self.patch = content.patch self.comment = content.comment
def test_git_rename(self): diff, message = find_content(self.project, self.mail) self.assertTrue(diff is not None) self.assertTrue(message is not None) self.assertEqual(diff.count("\nrename from "), 2) self.assertEqual(diff.count("\nrename to "), 2) self.assertEqual(diff.count('\n-a\n+b'), 1)
def testGitRename(self): (patch, comment) = find_content(self.project, self.mail) self.assertTrue(patch is not None) self.assertTrue(comment is not None) self.assertEqual(patch.content.count("\nrename from "), 2) self.assertEqual(patch.content.count("\nrename to "), 2) self.assertEqual(patch.content.count('\n-a\n+b'), 1)
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email(self.test_comment + '\n' + self.orig_patch) del email['Content-Type'] del email['Content-Transfer-Encoding'] content = find_content(self.project, email) self.patch = content.patch self.comment = content.comment
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email( self.test_content + '\n' + '_______________________________________________\n' + 'Linuxppc-dev mailing list\n' + self.orig_patch) self.patch, _, self.filenames = find_content(self.project, email)
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email(self.test_comment, multipart=True) attachment = MIMEText(self.orig_patch, _subtype=self.content_subtype) email.attach(attachment) content = find_content(self.project, email) self.patch = content.patch self.comment = content.comment
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email(self.test_comment, multipart = True) attachment = MIMEText(self.orig_patch, _subtype = self.content_subtype) email.attach(attachment) content = find_content(self.project, email) self.patch = content.patch self.comment = content.comment
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email( \ self.test_comment + '\n' + \ '_______________________________________________\n' + \ 'Linuxppc-dev mailing list\n' + \ self.orig_patch) (self.patch, self.comment) = find_content(self.project, email)
def testPatch(self): content = find_content(self.project, self.mail) patch = content.patch comment = content.comment self.assertTrue(patch is not None) self.assertTrue(comment is not None) self.assertTrue(patch.content.startswith('Index'))
def testGitPullWithDiff(self): (patch, comment) = find_content(self.project, self.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)
def setUp(self): email = create_email('\n'.join([ self.orig_content, '_______________________________________________', 'Linuxppc-dev mailing list', self.orig_diff])) self.project = create_project() self.diff, self.content = find_content(self.project, email)
def testGitPullRequest(self): content = find_content(self.project, self.mail) patch = content.patch comment = content.comment self.assertTrue(patch is not None) self.assertTrue(patch.pull_url is not None) self.assertTrue(patch.content is None) self.assertTrue(comment is not None)
def testGitRename(self): content = find_content(self.project, self.mail) patch = content.patch comment = content.comment self.assertTrue(patch is not None) self.assertTrue(comment is not None) self.assertEqual(patch.content.count("\nrename from "), 2) self.assertEqual(patch.content.count("\nrename to "), 2)
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email( \ self.test_comment + '\n' + \ '_______________________________________________\n' + \ 'Linuxppc-dev mailing list\n' + \ self.orig_patch) content = find_content(self.project, email) self.patch = content.patch self.comment = content.comment
def setUp(self): msg = MIMEMultipart() body = MIMEText(self.orig_content, _subtype='plain') attachment = MIMEText(self.orig_diff, _subtype=self.content_subtype) msg.attach(body) msg.attach(attachment) email = _create_email(msg) self.project = create_project() self.diff, self.content = find_content(self.project, email)
def test_git_pull_with_diff(self): diff, message = find_content(self.project, self.mail) pull_url = find_pull_request(message) self.assertEqual('git://git.kernel.org/pub/scm/linux/kernel/git/tip/' 'linux-2.6-tip.git x86-fixes-for-linus', pull_url) self.assertTrue( diff.startswith( 'diff --git a/arch/x86/include/asm/smp.h'), diff)
def testPatch(self): (patch, comment) = find_content(self.project, self.mail) self.assertTrue(patch is not None) self.assertTrue(comment is not None) self.assertTrue(patch.content.startswith('diff --git a/tools/testing/selftests/powerpc/Makefile')) # Confirm the trailing no newline marker doesn't end up in the comment self.assertFalse(comment.content.rstrip().endswith('\ No newline at end of file')) # Confirm it's instead at the bottom of the patch self.assertTrue(patch.content.rstrip().endswith('\ No newline at end of file')) # Confirm we got both markers self.assertEqual(2, patch.content.count('\ No newline at end of file'))
def testAttachment(self): """Attachments can be patches even with git_send_email_only true""" self.p1.git_send_email_only = True self.p1.save() email = self.get_email(multipart=True) content = find_content(self.p1, email) self.assertTrue(content.patch is not None) self.assertEquals(content.patch.content, self.patch) self.assertTrue(content.comment is not None) self.assertEquals(content.comment.content, 'See attached patch!')
def testGitPullWithDiff(self): content = find_content(self.project, self.mail) patch = content.patch comment = content.comment 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)
def testPatch(self): content = find_content(self.project, self.mail) patch = content.patch comment = content.comment self.assertTrue(patch is not None) self.assertTrue(comment is not None) self.assertTrue(patch.content.startswith( 'diff --git a/tools/testing/selftests/powerpc/Makefile')) # Confirm the trailing no newline marker doesn't end up in the comment self.assertFalse(comment.content.rstrip().endswith( '\ No newline at end of file')) # Confirm it's instead at the bottom of the patch self.assertTrue(patch.content.rstrip().endswith( '\ No newline at end of file')) # Confirm we got both markers self.assertEqual(2, patch.content.count('\ No newline at end of file'))
def testSubjectEncoding(self): (patch, comment) = find_content(self.project, self.email) self.assertEquals(patch.name, self.subject)
def testPatch(self): content = find_content(self.project, self.mail) self.assertTrue(content.patch is not None) self.assertTrue(content.comment is not None)
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email( self.test_content + '\n' + '-- \nsig\n' + self.orig_patch) self.patch, _, self.filenames = find_content(self.project, email)
def testGitRename(self): patch, _, _ = find_content(self.project, self.mail) self.assertTrue(patch is not None) self.assertEqual(patch.diff.count("\nrename from "), 2) self.assertEqual(patch.diff.count("\nrename to "), 2)
def testPatch(self): patch, comment, _ = find_content(self.project, self.mail) self.assertTrue(patch is not None) self.assertTrue(comment is None) self.assertTrue(patch.diff.startswith('Index'))
def testPatch(self): patch, comment, _ = find_content(self.project, self.mail) self.assertTrue(comment is None) self.assertTrue(patch.content is not None) self.assertTrue(patch.diff is not None)
def testSubjectEncoding(self): content = find_content(self.project, self.email) self.assertEqual(content.patch.name, self.subject)
def setUp(self): self.orig_patch = read_patch(self.patch_filename, self.patch_encoding) email = create_email(self.test_comment + "\n" + self.orig_patch, content_encoding=self.patch_encoding) (self.patch, self.comment) = find_content(self.project, email)
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email(self.test_comment + "\n" + self.orig_patch) del email["Content-Type"] del email["Content-Transfer-Encoding"] (self.patch, self.comment) = find_content(self.project, email)
def testGitPullRequest(self): (patch, comment) = find_content(self.project, self.mail) self.assertTrue(patch is not None) self.assertTrue(patch.pull_url is not None) self.assertTrue(patch.content is None) self.assertTrue(comment is not None)
def setUp(self): self.orig_patch = read_patch(self.patch_filename) email = create_email(self.test_comment + '\n' + self.orig_patch) (self.patch, self.comment) = find_content(self.project, email)