From d6da65b18f87725868bcc28cffaba7e3b4876c28 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 27 Feb 2012 16:35:17 +0100 Subject: [PATCH] tests: Fix test #4 1) Fix test #4 by deleting all local mailfolders remaining from previous tests, the mailfolder count will be off, otherwise. 2) Make folder deletion work in python3, it weirdly enough needs to be quoted like this to work in python3 (I found a python bug about this somewhere). Signed-off-by: Sebastian Spaeth --- test/OLItest/TestRunner.py | 4 ++-- test/tests/test_01_basic.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/OLItest/TestRunner.py b/test/OLItest/TestRunner.py index 1ce3b5f..fc06a87 100644 --- a/test/OLItest/TestRunner.py +++ b/test/OLItest/TestRunner.py @@ -158,12 +158,12 @@ class OLITestLib(): [^"]*$ # followed by no more quotes ''', d, flags=re.VERBOSE) folder = bytearray(m.group(1)) - folder = folder.replace(br'\"', b'"') # remove quoting + #folder = folder.replace(br'\"', b'"') # remove quoting dirs.append(folder) # 2) filter out those not starting with INBOX.OLItest and del... dirs = [d for d in dirs if d.startswith(b'INBOX.OLItest')] for folder in dirs: - res_t, data = imapobj.delete(str(folder)) + res_t, data = imapobj.delete(b'\"'+folder+b'\"') assert res_t == 'OK', "Folder deletion of {} failed with error"\ ":\n{} {}".format(folder.decode('utf-8'), res_t, data) imapobj.logout() diff --git a/test/tests/test_01_basic.py b/test/tests/test_01_basic.py index aadec72..f5a0ea1 100644 --- a/test/tests/test_01_basic.py +++ b/test/tests/test_01_basic.py @@ -112,6 +112,7 @@ class TestBasicFunctions(unittest.TestCase): 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()