Improve test suite and add test

1) Add helper functions to create and count maildirs and mails.

2) Add a second test that creates 2 maildirs, one of the including a
quotation sign " in its folder name and sync.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-01-20 15:55:44 +01:00
parent 58450fb22e
commit 314a4e3b2c
5 changed files with 46 additions and 17 deletions

View File

@ -55,17 +55,20 @@ class TestBasicFunctions(unittest.TestCase):
It syncs all "OLItest* (specified in the default config) to our
local Maildir at keeps it there."""
code, res = OLITestLib.run_OLI()
#logging.warn("%s %s "% (code, res))
self.assertEqual(res, "")
#TODO implement OLITestLib.countmails()
logging.warn("synced %d boxes, %d mails" % (0,0))
def test_02_wipedir(self):
"""Wipe OLItest* maildir, sync and see if it's still empty
boxes, mails = OLITestLib.count_maildir_mails('')
logging.warn("%d boxes and %d mails" % (boxes, mails))
Wipes all "OLItest* (specified in the default config) to our
local Maildir at keeps it there."""
def test_02_createdir(self):
"""Create local OLItest 1 & OLItest "1" maildir, sync
Folder names with quotes used to fail and have been fixed, so
one is included here as a small challenge."""
OLITestLib.create_maildir('INBOX.OLItest 1')
OLITestLib.create_maildir('INBOX.OLItest "1"')
code, res = OLITestLib.run_OLI()
#logging.warn("%s %s "% (code, res))
self.assertEqual(res, "")
boxes, mails = OLITestLib.count_maildir_mails('')
logging.warn("%d boxes and %d mails" % (boxes, mails))