コード例 #1
0
    def test_05_createmail(self):
        """Create mail in OLItest 1, sync, wipe folder sync

        Currently, this will mean the folder will be recreated
        locally.  At some point when remote folder deletion is
        implemented, this behavior will change."""
        OLITestLib.delete_remote_testfolders()
        OLITestLib.delete_maildir('')  # Delete all local maildir folders
        OLITestLib.create_maildir('INBOX.OLItest')
        OLITestLib.create_mail('INBOX.OLItest')
        code, res = OLITestLib.run_OLI()
        # logging.warn("%s %s "% (code, res))
        self.assertEqual(res, "")
        boxes, mails = OLITestLib.count_maildir_mails('')
        self.assertTrue(
            (boxes, mails) == (1, 1),
            msg="Expected 1 folders and 1 "
            "mails, but sync led to {0} folders and {1} mails".format(
                boxes, mails))
        # The local Mail should have been assigned a proper UID now, check!
        uids = OLITestLib.get_maildir_uids('INBOX.OLItest')
        self.assertFalse(
            None in uids,
            msg="All mails should have been "
            "assigned the IMAP's UID number, but {0} messages had no valid ID "
            .format(len([None for x in uids if x is None])))
コード例 #2
0
    def test_05_createmail(self):
        """Create mail in OLItest 1, sync, wipe folder sync

        Currently, this will mean the folder will be recreated
        locally.  At some point when remote folder deletion is
        implemented, this behavior will change."""
        OLITestLib.delete_remote_testfolders()
        OLITestLib.delete_maildir('') #Delete all local maildir folders
        OLITestLib.create_maildir('INBOX.OLItest')
        OLITestLib.create_mail('INBOX.OLItest')
        code, res = OLITestLib.run_OLI()
        #logging.warn("%s %s "% (code, res))
        self.assertEqual(res, "")
        boxes, mails = OLITestLib.count_maildir_mails('')
        self.assertTrue((boxes, mails)==(1,1), msg="Expected 1 folders and 1 "
            "mails, but sync led to {0} folders and {1} mails".format(
                boxes, mails))
        # The local Mail should have been assigned a proper UID now, check!
        uids = OLITestLib.get_maildir_uids('INBOX.OLItest')
        self.assertFalse (None in uids, msg = "All mails should have been "+ \
            "assigned the IMAP's UID number, but {0} messages had no valid ID "\
            .format(len([None for x in uids if x==None])))