MCPcopy
hub / github.com/OfflineIMAP/offlineimap / test_05_createmail

Method test_05_createmail

test/tests/test_01_basic.py:111–132  ·  view source on GitHub ↗

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.

(self)

Source from the content-addressed store, hash-verified

109
110
111 def test_05_createmail(self):
112 """Create mail in OLItest 1, sync, wipe folder sync
113
114 Currently, this will mean the folder will be recreated
115 locally. At some point when remote folder deletion is
116 implemented, this behavior will change."""
117 OLITestLib.delete_remote_testfolders()
118 OLITestLib.delete_maildir('') #Delete all local maildir folders
119 OLITestLib.create_maildir('INBOX.OLItest')
120 OLITestLib.create_mail('INBOX.OLItest')
121 code, res = OLITestLib.run_OLI()
122 #logging.warn("%s %s "% (code, res))
123 self.assertEqual(res, "")
124 boxes, mails = OLITestLib.count_maildir_mails('')
125 self.assertTrue((boxes, mails)==(1,1), msg="Expected 1 folders and 1 "
126 "mails, but sync led to {0} folders and {1} mails".format(
127 boxes, mails))
128 # The local Mail should have been assigned a proper UID now, check!
129 uids = OLITestLib.get_maildir_uids('INBOX.OLItest')
130 self.assertFalse (None in uids, msg = "All mails should have been "+ \
131 "assigned the IMAP's UID number, but {0} messages had no valid ID "\
132 .format(len([None for x in uids if x==None])))
133
134 def test_06_createfolders(self):
135 """Test if createfolders works as expected

Callers

nothing calls this directly

Calls 8

delete_maildirMethod · 0.80
create_maildirMethod · 0.80
create_mailMethod · 0.80
run_OLIMethod · 0.80
count_maildir_mailsMethod · 0.80
get_maildir_uidsMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected