From ecc2af9f99523cdba137ac059056de8f9ed16c5e Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Mon, 23 Mar 2015 17:43:55 +0100 Subject: [PATCH] test: handle literal string Tuple are used for literal strings (see RFC3501 Section 4.3). Signed-off-by: Pierre-Louis Bonicoli Signed-off-by: Nicolas Sebrecht --- test/OLItest/TestRunner.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/OLItest/TestRunner.py b/test/OLItest/TestRunner.py index 33ba6fa..e7fbaa7 100644 --- a/test/OLItest/TestRunner.py +++ b/test/OLItest/TestRunner.py @@ -148,12 +148,16 @@ class OLITestLib(): assert res_t == 'OK' dirs = [] for d in data: - m = re.search(br''' - (" # starting quote - ([^"]|\\")* # a non-quote or a backslashded quote - ")$ # ending quote - ''', d, flags=re.VERBOSE) - folder = bytearray(m.group(1)) + if isinstance(d, tuple): + # literal (unquoted) + folder = b'"%s"' % d[1].replace('"', '\\"') + else: + 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...