wintest: fixed casefold handling in expect calls
authorAndrew Tridgell <tridge@samba.org>
Wed, 1 Dec 2010 02:24:35 +0000 (13:24 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 1 Dec 2010 05:09:57 +0000 (16:09 +1100)
wintest/wintest.py

index cc24c0d..201ed08 100644 (file)
@@ -231,7 +231,12 @@ class wintest():
         def expect_sub(line, timeout=ret.timeout, casefold=casefold):
             line = self.substitute(line)
             if casefold:
-                line = "(?i)" + line
+                if isinstance(line, list):
+                    for i in range(len(line)):
+                        if isinstance(line[i], str):
+                            line[i] = '(?i)' + line[i]
+                elif isinstance(line, str):
+                    line = '(?i)' + line
             return ret.old_expect(line, timeout=timeout)
 
         ret.old_sendline = ret.sendline