test: Create all intermediary maildirs

Don't fail if root maildir folder does not exist it. Create it recursively.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2012-02-16 09:55:26 +01:00
parent da0ba2e266
commit c1f75a6c94

View File

@ -108,7 +108,7 @@ class OLITestLib():
maildir = os.path.join(cls.testdir, 'mail', folder) maildir = os.path.join(cls.testdir, 'mail', folder)
for subdir in ('','tmp','cur','new'): for subdir in ('','tmp','cur','new'):
try: try:
os.mkdir(os.path.join(maildir, subdir)) os.makedirs(os.path.join(maildir, subdir))
except OSError as e: except OSError as e:
if e.errno != 17: # 'already exists' is ok. if e.errno != 17: # 'already exists' is ok.
raise raise