tests: Add tests for imaputil.* functions

Add one test for each of the functions in offlineimap.imaputil, to make
sure they keep working. These functions tests the internal innards of
the offlineimap module rather than invoking offlineimap as a program.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-04-03 01:34:59 +02:00
parent c708e36ff7
commit f67278b2a8
3 changed files with 100 additions and 5 deletions

View File

@ -24,10 +24,8 @@ import subprocess
import tempfile
import random
random.seed()
try:
from configparser import SafeConfigParser
except ImportError: # python 2
from ConfigParser import SafeConfigParser
from offlineimap.CustomConfig import CustomConfigParser
from . import default_conf
@ -75,7 +73,7 @@ class OLITestLib():
#TODO, only do first time and cache then for subsequent calls?
assert cls.cred_file != None
assert cls.testdir != None
config = SafeConfigParser()
config = CustomConfigParser()
config.readfp(default_conf)
default_conf.seek(0) # rewind config_file to start
config.read(cls.cred_file)