示例#1
0
    def _fdoc(self, next_uid, mailbox):
        if self._fd:
            return self._fd

        fd = {}
        fd[fields.MBOX] = mailbox
        fd[fields.MBOX_UUID] = next_uid
        fd[fields.CONTENT_HASH] = self._get_chash()
        fd[SIZE_KEY] = len(self.raw)
        fd[MULTIPART_KEY] = True
        fd[fields.RECENT] = True
        fd[fields.TYPE] = fields.FLAGS
        fd[fields.FLAGS] = Status.to_flags(self._status)
        self._fd = fd
        return fd
示例#2
0
    def _fdoc(self, next_uid, mailbox):
        if self._fd:
            return self._fd

        fd = {}
        fd[fields.MBOX_KEY] = mailbox
        fd[fields.UID_KEY] = next_uid
        fd[fields.CONTENT_HASH_KEY] = self._get_chash()
        fd[fields.SIZE_KEY] = len(self.raw)
        fd[fields.MULTIPART_KEY] = True
        fd[fields.RECENT_KEY] = True
        fd[fields.TYPE_KEY] = fields.TYPE_FLAGS_VAL
        fd[fields.FLAGS_KEY] = Status.to_flags(self._status)
        self._fd = fd
        return fd
 def test_bulk_conversion(self):
     statuses = Status.from_flags(['\\Answered', '\\Seen', '\\Recent', 'tag_a_custom'])
     self.assertEquals(set(['read', 'replied', 'recent']), statuses)
 def test_leap_answered_flag_is_translated_to_replied_status(self):
     status = Status.from_flag('\\Answered')
     self.assertEquals('replied', status)
 def test_leap_seen_flag_is_translated_to_read_status(self):
     status = Status.from_flag('\\Seen')
     self.assertEquals('read', status)
示例#6
0
 def status(self):
     return Status.from_flags(self.flags)
示例#7
0
 def with_status(self, flags):
     for status in Status.from_flags(flags):
         self.mail['status'].append(status)
     return self
示例#8
0
 def status(self):
     return Status.from_flags(self.flags)
示例#9
0
 def is_recent(self):
     return Status('recent') in self.status
示例#10
0
 def test_bulk_conversion(self):
     statuses = Status.from_flags(
         ['\\Answered', '\\Seen', '\\Recent', 'tag_a_custom'])
     self.assertEquals(set(['read', 'replied', 'recent']), statuses)
示例#11
0
 def test_leap_answered_flag_is_translated_to_replied_status(self):
     status = Status.from_flag('\\Answered')
     self.assertEquals('replied', status)
示例#12
0
 def test_leap_seen_flag_is_translated_to_read_status(self):
     status = Status.from_flag('\\Seen')
     self.assertEquals('read', status)