From be89a7605f7a011345e51a780ea270fce0f5cef2 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Mon, 23 Mar 2015 12:13:23 +0100 Subject: [PATCH] test: folders: keep quotes Signed-off-by: Pierre-Louis Bonicoli Signed-off-by: Nicolas Sebrecht --- test/OLItest/TestRunner.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/OLItest/TestRunner.py b/test/OLItest/TestRunner.py index f768018..33ba6fa 100644 --- a/test/OLItest/TestRunner.py +++ b/test/OLItest/TestRunner.py @@ -148,20 +148,18 @@ class OLITestLib(): assert res_t == 'OK' dirs = [] for d in data: - m = re.search(br''' # Find last quote - "((?: # Non-tripple quoted can contain... - [^"] | # a non-quote - \\" # a backslashded quote - )*)" # closing quote - [^"]*$ # followed by no more quotes + m = re.search(br''' + (" # starting quote + ([^"]|\\")* # a non-quote or a backslashded quote + ")$ # ending quote ''', d, flags=re.VERBOSE) folder = bytearray(m.group(1)) #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') or d.startswith(b'INBOX/OLItest')] + dirs = [d for d in dirs if d.startswith(b'"INBOX.OLItest') or d.startswith(b'"INBOX/OLItest')] for folder in dirs: - res_t, data = imapobj.delete(b'\"'+folder+b'\"') + res_t, data = imapobj.delete(folder) assert res_t == 'OK', "Folder deletion of {0} failed with error"\ ":\n{1} {2}".format(folder.decode('utf-8'), res_t, data) imapobj.logout()