Beispiel #1
0
    def setUp(self):
        self.p = Project(linkname='test-project-1',
                         name='Project 1',
                         listid='1.example.com',
                         listemail='*****@*****.**')

        self.p.save()

        patch = read_patch(self.patch_filename)
        patch1 = create_email(self.test_comment + '\n' + patch,
                              subject="[PATCH 1/2] Meep Meep]")

        patch2 = create_email(self.test_comment + '\n' + patch,
                              subject="[PATCH 2/2] Meep Meep2]",
                              in_reply_to=patch1['Message-Id'])

        self.patch_update = create_email(self.test_comment + '\n' + patch,
                                         subject="[PATCH v2] Meep Meep2",
                                         in_reply_to=patch2['Message-Id'])

        self.comment = create_email(self.test_comment,
                                    subject="Re: [PATCH] Meep Meep2",
                                    in_reply_to=patch2['Message-Id'])

        for email in [patch1, patch2, self.patch_update, self.comment]:
            del email['List-ID']
            email['List-ID'] = '<' + self.p.listid + '>'

        parse_mail(patch1)
        parse_mail(patch2)
Beispiel #2
0
    def testSingleTag(self):
        self.project2.subject_prefix_tags = 'i-g-t'
        self.project2.save()

        email = create_email(defaults.patch, project=self.project1,
                             subject='[PATCH] Subject')
        self.assertEquals(find_project(email), self.project1)
        email = create_email(defaults.patch, project=self.project1,
                             subject='[PATCH i-g-t] Subject')
        self.assertEquals(find_project(email), self.project2)
Beispiel #3
0
 def get_email(self, multipart=False):
     if multipart:
         email = create_email('See attached patch!', multipart=multipart)
         attachment = MIMEText(self.patch, _subtype='x-patch')
         email.attach(attachment)
     else:
         email = create_email(self.patch)
     del email['List-ID']
     email['List-ID'] = '<' + self.p1.listid + '>'
     email['Message-Id'] = self.msgid
     return email
Beispiel #4
0
    def testSingleTagInverted(self):
        """To test the order_by()"""
        self.project1.subject_prefix_tags = 'i-g-t'
        self.project1.save()
        self.project2.subject_prefix_tags = ' '
        self.project2.save()

        email = create_email(defaults.patch, project=self.project1,
                             subject='[PATCH i-g-t] Subject')
        self.assertEquals(find_project(email), self.project1)
        email = create_email(defaults.patch, project=self.project1,
                             subject='[PATCH] Subject')
        self.assertEquals(find_project(email), self.project2)
Beispiel #5
0
    def testMultipleTags(self):
        self.project2.subject_prefix_tags = 'i-g-t,intel-gpu-tools'
        self.project2.save()

        email = create_email(defaults.patch, project=self.project1,
                             subject='[PATCH] Subject')
        self.assertEquals(find_project(email), self.project1)
        email = create_email(defaults.patch, project=self.project1,
                             subject='[PATCH i-g-t] Subject')
        self.assertEquals(find_project(email), self.project2)
        email = create_email(defaults.patch, project=self.project1,
                             subject='[PATCH intel-gpu-tools] Subject')
        self.assertEquals(find_project(email), self.project2)
Beispiel #6
0
    def setUp(self):
        self.p1 = Project(linkname='test-project-1',
                          name='Project 1',
                          listid='1.example.com',
                          listemail='*****@*****.**')
        self.p2 = Project(linkname='test-project-2',
                          name='Project 2',
                          listid='2.example.com',
                          listemail='*****@*****.**')

        self.p1.save()
        self.p2.save()

        patch = read_patch(self.patch_filename)
        email = create_email(self.test_comment + '\n' + patch)
        del email['Message-Id']
        email['Message-Id'] = self.msgid

        del email['List-ID']
        email['List-ID'] = '<' + self.p1.listid + '>'
        parse_mail(email)

        del email['List-ID']
        email['List-ID'] = '<' + self.p2.listid + '>'
        parse_mail(email)
Beispiel #7
0
 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
Beispiel #8
0
 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):
     project = create_project(listid='test.example.com')
     self.orig_patch = read_patch(self.patch_filename)
     email = create_email(self.test_content + '\n' + self.orig_patch,
                          project=project)
     email['Message-Id'] = '<*****@*****.**>'
     parse_mail(email)
Beispiel #10
0
 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
Beispiel #11
0
 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
Beispiel #12
0
 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)
Beispiel #13
0
 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
Beispiel #14
0
 def testStripTag(self):
     self.project2.subject_prefix_tags = 'i-g-t'
     self.project2.save()
     email = create_email(defaults.patch, project=self.project1,
                          subject='[PATCH i-g-t] Subject')
     parse_mail(email)
     patch = Patch.objects.all()[0]
     self.assertEquals(patch.name, 'Subject')
Beispiel #15
0
 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
Beispiel #16
0
 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)
Beispiel #17
0
 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
Beispiel #18
0
 def setUp(self):
     project = defaults.project
     project.listid = 'test.example.com'
     project.save()
     self.orig_patch = read_patch(self.patch_filename)
     email = create_email(self.test_comment + '\n' + self.orig_patch,
                          project=project)
     email['Message-Id'] = '<*****@*****.**>'
     parse_mail(email)
Beispiel #19
0
 def testStripListemailTag(self):
     self.project3.subject_prefix_tags = 'i-g-t'
     self.project3.listemail = '*****@*****.**'
     self.project3.save()
     email = create_email(defaults.patch,
                          project=self.project3,
                          subject='[intel-gfx] [PATCH i-g-t] Subject')
     parse_mail(email)
     patch = Patch.objects.all()[0]
     self.assertEquals(patch.name, 'Subject')
Beispiel #20
0
 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):
        self.p1 = create_project()
        self.p2 = create_project()

        patch = read_patch(self.patch_filename)
        email = create_email(self.test_content + '\n' + patch)
        del email['Message-Id']
        email['Message-Id'] = self.msgid

        del email['List-ID']
        email['List-ID'] = '<' + self.p1.listid + '>'
        parse_mail(email)

        del email['List-ID']
        email['List-ID'] = '<' + self.p2.listid + '>'
        parse_mail(email)
Beispiel #22
0
    def setUp(self):
        self.p1 = Project(linkname = 'test-project-1', name = 'Project 1',
                listid = '1.example.com', listemail='*****@*****.**')
        self.p2 = Project(linkname = 'test-project-2', name = 'Project 2',
                listid = '2.example.com', listemail='*****@*****.**')

        self.p1.save()
        self.p2.save()

        patch = read_patch(self.patch_filename)
        email = create_email(self.test_comment + '\n' + patch)
        email['Message-Id'] = self.msgid

        del email['List-ID']
        email['List-ID'] = '<' + self.p1.listid + '>'
        parse_mail(email)

        del email['List-ID']
        email['List-ID'] = '<' + self.p2.listid + '>'
        parse_mail(email)
Beispiel #23
0
    def setUp(self):
        self.p1 = Project(
            linkname="test-project-1", name="Project 1", listid="1.example.com", listemail="*****@*****.**"
        )
        self.p2 = Project(
            linkname="test-project-2", name="Project 2", listid="2.example.com", listemail="*****@*****.**"
        )

        self.p1.save()
        self.p2.save()

        patch = read_patch(self.patch_filename)
        email = create_email(self.test_comment + "\n" + patch)
        email["Message-Id"] = self.msgid

        del email["List-ID"]
        email["List-ID"] = "<" + self.p1.listid + ">"
        parse_mail(email)

        del email["List-ID"]
        email["List-ID"] = "<" + self.p2.listid + ">"
        parse_mail(email)
 def setUp(self):
     self.orig_patch = read_patch(self.patch_filename)
     email = create_email(self.test_content + '\n' + self.orig_patch)
     del email['Content-Type']
     del email['Content-Transfer-Encoding']
     self.diff, self.message = find_content(self.project, email)
Beispiel #25
0
 def get_email(self):
     email = create_email(self.patch)
     del email['List-ID']
     email['List-ID'] = '<' + self.p1.listid + '>'
     email['Message-Id'] = self.msgid
     return email
 def setUp(self):
     self.orig_patch = read_patch(self.patch_filename, self.patch_encoding)
     email = create_email(self.test_content + '\n' + self.orig_patch,
                          content_encoding=self.patch_encoding)
     self.diff, self.message = find_content(self.project, email)
Beispiel #27
0
 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)
Beispiel #28
0
 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)
Beispiel #29
0
 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)
Beispiel #30
0
 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)