test: folders: keep quotes
Signed-off-by: Pierre-Louis Bonicoli <pierre-louis.bonicoli@gmx.fr> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
afcd640035
commit
be89a7605f
@ -148,20 +148,18 @@ class OLITestLib():
|
|||||||
assert res_t == 'OK'
|
assert res_t == 'OK'
|
||||||
dirs = []
|
dirs = []
|
||||||
for d in data:
|
for d in data:
|
||||||
m = re.search(br''' # Find last quote
|
m = re.search(br'''
|
||||||
"((?: # Non-tripple quoted can contain...
|
(" # starting quote
|
||||||
[^"] | # a non-quote
|
([^"]|\\")* # a non-quote or a backslashded quote
|
||||||
\\" # a backslashded quote
|
")$ # ending quote
|
||||||
)*)" # closing quote
|
|
||||||
[^"]*$ # followed by no more quotes
|
|
||||||
''', d, flags=re.VERBOSE)
|
''', d, flags=re.VERBOSE)
|
||||||
folder = bytearray(m.group(1))
|
folder = bytearray(m.group(1))
|
||||||
#folder = folder.replace(br'\"', b'"') # remove quoting
|
#folder = folder.replace(br'\"', b'"') # remove quoting
|
||||||
dirs.append(folder)
|
dirs.append(folder)
|
||||||
# 2) filter out those not starting with INBOX.OLItest and del...
|
# 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:
|
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"\
|
assert res_t == 'OK', "Folder deletion of {0} failed with error"\
|
||||||
":\n{1} {2}".format(folder.decode('utf-8'), res_t, data)
|
":\n{1} {2}".format(folder.decode('utf-8'), res_t, data)
|
||||||
imapobj.logout()
|
imapobj.logout()
|
||||||
|
Loading…
Reference in New Issue
Block a user