mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
test: fix code and test
This commit is contained in:
@@ -301,10 +301,11 @@ class IMAPconnector:
|
||||
key = "SUBJECT"
|
||||
else:
|
||||
continue
|
||||
if pattern:
|
||||
criterions = or_criterion(criterions, f'({key} "{pattern}")')
|
||||
else:
|
||||
criterions = "ALL"
|
||||
|
||||
criterions = or_criterion(criterions, f'({key} "{pattern}")')
|
||||
|
||||
if not pattern:
|
||||
criterions = "ALL"
|
||||
self.criterions = [bytearray(criterions, "utf8")]
|
||||
|
||||
def messages_count(self, **kwargs) -> int:
|
||||
|
||||
@@ -16,7 +16,7 @@ class ImapUtilsTestCase(unittest.TestCase):
|
||||
"""Test with Criterion and pattern"""
|
||||
self.imap_connector.criterions = []
|
||||
self.imap_connector.parse_search_parameters("from_addr", "bob")
|
||||
result = [bytearray('FROM "bob"', "utf8")]
|
||||
result = [bytearray('(FROM "bob")', "utf8")]
|
||||
self.assertEqual(self.imap_connector.criterions, result)
|
||||
|
||||
def test_criterions_one_criterion_without_pattern(self):
|
||||
|
||||
Reference in New Issue
Block a user