예제 #1
0
    def test_project_with_regex(self):
        self.email['Subject'] = '[PATCH PROJECT X subsystem]'
        project = find_project(self.email)
        self.assertEqual(project, self.project_x)

        self.email['Subject'] = '[PATCH PROJECTX another subsystem]'
        project = find_project(self.email)
        self.assertEqual(project, self.project_x)
예제 #2
0
    def test_default_project(self):
        self.email['Subject'] = '[PATCH unknown project]'
        project = find_project(self.email)
        self.assertEqual(project, self.default_project)

        self.email['Subject'] = '[PATCH NOT-PROJECT-X]'
        project = find_project(self.email)
        self.assertEqual(project, self.default_project)
예제 #3
0
    def test_project_with_regex(self):
        self.email['Subject'] = '[PATCH PROJECT X subsystem]'
        project = find_project(self.email)
        self.assertEqual(project, self.project_x)

        self.email['Subject'] = '[PATCH PROJECTX another subsystem]'
        project = find_project(self.email)
        self.assertEqual(project, self.project_x)
예제 #4
0
    def test_default_project(self):
        self.email['Subject'] = '[PATCH unknown project]'
        project = find_project(self.email)
        self.assertEqual(project, self.default_project)

        self.email['Subject'] = '[PATCH NOT-PROJECT-X]'
        project = find_project(self.email)
        self.assertEqual(project, self.default_project)
예제 #5
0
 def test_short_list_id(self):
     """Some mailing lists have List-Id headers in short formats, where it
        is only the list ID itself (without enclosing angle-brackets). """
     email = MIMEText('')
     email['List-Id'] = self.project.listid
     project = find_project(email)
     self.assertEqual(project, self.project)
예제 #6
0
 def test_short_list_id(self):
     """Some mailing lists have List-Id headers in short formats, where it
        is only the list ID itself (without enclosing angle-brackets). """
     email = MIMEText('')
     email['List-Id'] = self.project.listid
     project = find_project(email)
     self.assertEqual(project, self.project)
예제 #7
0
 def test_long_list_id(self):
     email = MIMEText('')
     email['List-Id'] = 'Test text <%s>' % self.project.listid
     project = find_project(email)
     self.assertEqual(project, self.project)
예제 #8
0
 def test_substring_list_id(self):
     email = MIMEText('')
     email['List-Id'] = 'example.com'
     project = find_project(email)
     self.assertEqual(project, None)
예제 #9
0
 def test_whitespace_list_id(self):
     email = MIMEText('')
     email['List-Id'] = ' '
     project = find_project(email)
     self.assertEqual(project, None)
예제 #10
0
 def test_whitespace_list_id(self):
     email = MIMEText('')
     email['List-Id'] = ' '
     project = find_project(email)
     self.assertEqual(project, None)
예제 #11
0
 def test_nonexistent_project(self):
     project = find_project(self.email_no_project)
     self.assertEqual(project, None)
예제 #12
0
 def test_nonexistent_project(self):
     project = find_project(self.email_no_project)
     self.assertEqual(project, None)
예제 #13
0
 def test_project_with_keyword(self):
     self.email['Subject'] = '[PATCH keyword] subsystem'
     project = find_project(self.email)
     self.assertEqual(project, self.keyword_project)
예제 #14
0
 def test_long_list_id(self):
     email = MIMEText('')
     email['List-Id'] = 'Test text <%s>' % self.project.listid
     project = find_project(email)
     self.assertEqual(project, self.project)
예제 #15
0
 def test_substring_list_id(self):
     email = MIMEText('')
     email['List-Id'] = 'example.com'
     project = find_project(email)
     self.assertEqual(project, None)
예제 #16
0
 def test_project_with_keyword(self):
     self.email['Subject'] = '[PATCH keyword] subsystem'
     project = find_project(self.email)
     self.assertEqual(project, self.keyword_project)
예제 #17
0
 def test_list_id_override(self):
     project = find_project(self.email_no_project,
                            self.keyword_project.listid)
     self.assertEqual(project, self.keyword_project)
예제 #18
0
 def test_no_list_id(self):
     email = MIMEText('')
     project = find_project(email)
     self.assertEqual(project, None)
예제 #19
0
 def test_list_id_override(self):
     project = find_project(self.email_no_project,
                            self.keyword_project.listid)
     self.assertEqual(project, self.keyword_project)
예제 #20
0
 def test_no_list_id(self):
     email = MIMEText('')
     project = find_project(email)
     self.assertEqual(project, None)