test: handle literal string

Tuple are used for literal strings (see RFC3501 Section 4.3).

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:
Pierre-Louis Bonicoli 2015-03-23 17:43:55 +01:00 committed by Nicolas Sebrecht
parent 4a5f32febd
commit ecc2af9f99

View File

@ -148,6 +148,10 @@ class OLITestLib():
assert res_t == 'OK' assert res_t == 'OK'
dirs = [] dirs = []
for d in data: for d in data:
if isinstance(d, tuple):
# literal (unquoted)
folder = b'"%s"' % d[1].replace('"', '\\"')
else:
m = re.search(br''' m = re.search(br'''
(" # starting quote (" # starting quote
([^"]|\\")* # a non-quote or a backslashded quote ([^"]|\\")* # a non-quote or a backslashded quote